problem with plotting a 3D graph
Mostra commenti meno recenti
Hi,
Please I need help to get the following code working:
Blue = [2 3 4 5 6]';
Green = [2 4 6 10 12]';
Red = [3 6 9 12 15]';
BL = Blue(1:end);
GR = Green(1:end);
RD = Red(1:end);
join = [];
for i = 1:GR
for j = 1:RD
join(i+1,j+1) = BL;
end;
end;
surf(join)
When I ran the code in Matlab, I got the following error message: "??? Subscripted assignment dimension mismatch." My intention was to plot the data in 3D.
Thanks
James
1 Commento
Azzi Abdelmalek
il 9 Ago 2012
why
BL = Blue(1:end);
you can writte
BL = Blue
Risposta accettata
Più risposte (2)
Azzi Abdelmalek
il 9 Ago 2012
Modificato: Azzi Abdelmalek
il 9 Ago 2012
%if you want plot a 3D graph with x axis Blue and Yaxis Green and corresponding data : example : z=rand(5,5)
Blue = [2 3 4 5 6]';
Green = [2 4 6 10 12]';
z=rand(5,5)
surf(Blue,Green,z)
1 Commento
James
il 9 Ago 2012
Kartik Verma
il 1 Dic 2020
0 voti
Take two vectors, x and y, of your choice of length 50. Consider a function
z=x^2+y^2-xy
Make a 3D surface plot for x,y and z with proper axis titles, legends etc.
Categorie
Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!