this might be newbie Q,
i have 3d matrix array, for example size 240x360x40.
i want to plot it into 3D graph. however when i use mesh,
it gives error like this
??? Error using ==> mesh
Z must be a matrix, not a scalar or vector.
??? CData must be an M-by-N matrix or M-by-N-by-3 array.
Error in ==> mesh at 93
hh = graph3d.surfaceplot
(x,'FaceColor',fc,'EdgeColor','flat', ..
----------------------------------------
if i used plot3, the error is :
>> plot3(a, 'x')
??? Error using ==> plot3
Data may not have more than 2 dimensions
size a = 240 360 40
i try to use other plot like surf.
the only plot succes is when i plot 2 dimension of the
data :
example mesh(a(:,:,1));
please help TQ
TQ
the only plot i can make is
Not enough input arguments.
You need to understand what you're plotting before you plot it.
Each element of the 3D matrix, A, has an 3 indices, x,y,z, and a value, A(x,y,z).
What do the indices represent in your data? I.e., what does the position of the
value in the matrix represent?
What does the value itself represent?
Are there dependent and independent variables?
Now decide what you want to plot.
Most likely, you really want to plot multiple 2D planes from your data, eg.
offset=max(A(:));figure; hold on; for i=1:40; surf(A(:,:,i)+offset*(i-1));end
I added an offset so the surfs would be stacked. 40 planes of 240x360 is likely
too much info to visualize all at once.
(For mesh(X,Y,Z) and surf(X,Y,Z) , each of the input matrices represents a
coordinate value. It's like plot3(X(:),Y(:),Z(:),'o') without all the nice graphics.)
Regards
Rajendra
"Ethan " <emontag...@leuzeusa.com> wrote in message <fuq3bt$l9r$1...@fred.mathworks.com>...
Regards
Rajendra
"Ethan " <emontag...@leuzeusa.com> wrote in message <fuq3bt$l9r$1...@fred.mathworks.com>...