build a Surface plot
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a table with 100 rows and 8 columns. I am trying to plot for any 3 variables from these data. How can i do it?
1 Kommentar
KSSV
am 16 Okt. 2017
What data is table? It depends on what data you have and what you want to plot.
Antworten (1)
Bjorn Gustavsson
am 16 Okt. 2017
Have a look at the trisurf function, and if that's not good enough there used to be a couple of similar functions for making surface plots of triangulated meshes.
HTH
4 Kommentare
Bjorn Gustavsson
am 18 Okt. 2017
Yes that is because the surface plots expect the input Z to be a matrix. For data in your format where you wand to connect your points in the vectors X Y and Z to a surface you might have to do a Delaunay-triangulation to generate a number of triangles connecting your points, after that you should be able to use the trisurf function. If your points are in a 10-by-10 grid you could simply reshape the vectors and use surf:
X = reshape(X,[10,10]);
Y = reshape(Y,[10,10]);
Z = reshape(Z,[10,10]);
surf(X,Y,Z)
If that doesn't work use trisurf according to its help.
First just plot the points to see which of the above solutions works for your case:
plot3(X,Y,Z,'*-')
HTH
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!