Using surf to plot a F(x,y,z) function on a surface

2 visualizzazioni (ultimi 30 giorni)
Gabriel
Gabriel il 28 Nov 2014
Risposto: Gabriel il 1 Dic 2014
Hello everyone,
I need to plot a scalar value stored in a vector Q on a 3D surface defined by vectors x, y and z. All those vectors have the same length. The points(x,y,z) are on a surface corresponding to a mesh (generated by comsol). The problem I have is that it seems to me that none of the matlab functions are made to do what I want with those "raw" data without processing them.
At first I achieved to solve this problem by transforming each of those vectors in a square matrix of size nxn with n the square root of the length of the above vectors.
But that was for points (x,y,z) generated by myself on a sphere (not with comsol). Now, with the points form the mesh, first I don't have vectors of a size "square rootable" and furthermore since the points are in a more random order (I presume), the surf function give me horrile figure with triangle going from on side of the surface to another (so basically the figure doesn't represent the surface).
So basically my question is how to have a nice plot of my scalar value (coded as a color) on a 3D surface defined by some (x,y,z) points (approximately like with scatter3 but with the space between the point filled)?
Thanks

Risposte (1)

Gabriel
Gabriel il 1 Dic 2014
Nobody knows ?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by