3D plane in MATLAB
22 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm given data for x,y, and z. I want to plot a 3D plane in MATLAB using the surf command.
I have following data e.g
x= [1.....5];
y= [0.001..... 0.8];
z= [0.996297743.... 0.429003632];
% Here x,y are independent variables and z is dependent variable.
% I could plot it using plot3 command
plot3(x,y,z)
% But how should I plot it by using surf command in MATLAB?
% I have tried
surface(x,y,z) % it gives error
% I even tried
[r,l]= meshgrid(x,y);
surf(r,l,z)
I'm not sure how to pass the arguments. Please Help!
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 4 Nov 2013
Modifié(e) : Azzi Abdelmalek
le 4 Nov 2013
X=reshape(x,17,3)'
Y=reshape(y,17,3)'
Z=reshape(z,17,3)'
mesh(X,Y,Z)
%or
surf(X,Y,Z)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!