http://www.mathworks.com/matlabcentral/newsreader/view_thread/280756
MATLAB Central Newsreader  Plotting a 3d ocean temperature map
Feed for thread: Plotting a 3d ocean temperature map
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Wed, 28 Apr 2010 18:46:04 +0000
Plotting a 3d ocean temperature map
http://www.mathworks.com/matlabcentral/newsreader/view_thread/280756#740266
Sarah Bonham
Hi, <br>
I am trying to plot a 3d image from a netcdf file using the variable temp_ym_dpth, which is ocean temperatures with depth.<br>
<br>
The matrix is 3D: 20x144x288 (depth x long x lat). <br>
<br>
I would like to plot a 3d profile of the Pacific, from 100E300E and 90S90N with depths 1 to 20.<br>
<br>
So far I have tried surf(squeeze(temp_ym_dpth)) but it returns the error: <br>
<br>
CData must be an MbyN matrix or MbyNby3 array<br>
error in > surf at 97<br>
hh = double(graph3d.surfaceplot(args(:),'parent',parax));<br>
<br>
I also tried defining the region first, but that didn't work either.<br>
<br>
I typed ndim to check the dimensions in case it was 4D, but it is 3D.<br>
<br>
I apologise if this is a simple question; I haven't been using matlab for long, but is there another way of producing a 3D image or could anyone tell me where I am going wrong?<br>
<br>
any help is greatly appreicated;<br>
<br>
thank you in advance,<br>
<br>
Sarah

Wed, 28 Apr 2010 19:27:07 +0000
Re: Plotting a 3d ocean temperature map
http://www.mathworks.com/matlabcentral/newsreader/view_thread/280756#740284
Walter Roberson
Sarah Bonham wrote:<br>
> Hi, I am trying to plot a 3d image from a netcdf file using the variable <br>
> temp_ym_dpth, which is ocean temperatures with depth.<br>
> <br>
> The matrix is 3D: 20x144x288 (depth x long x lat).<br>
> I would like to plot a 3d profile of the Pacific, from 100E300E and <br>
> 90S90N with depths 1 to 20.<br>
> <br>
> So far I have tried surf(squeeze(temp_ym_dpth)) but it returns the error:<br>
> CData must be an MbyN matrix or MbyNby3 array<br>
<br>
<br>
A 3D plot would require two dimensions of coordinates and one dimension of <br>
resulting values (the values stored in the matrix.)<br>
<br>
As you have three dimensions of coordinates and one dimension of resulting <br>
values, you are attempting to do a 4D plot.About the best you could hope for <br>
in a case like this would be to do one surface per depth, with the FaceAlpha <br>
largest for the bottommost plot and smallest for the topmost plot, so that <br>
you can get a general (but obscured) idea of what things are like at the lower <br>
layers.<br>
<br>
Beyond that, you need to work with plotting isosurfaces  3D plots that mark <br>
the boundaries of areas that are all the same value. Sort of like a contour.<br>
<br>
This kind of data, with 3 spacial directions and one measurement, are probably <br>
best handled by voxelviewing techniques, but Matlab is not very rich in voxel <br>
handling tools.

Wed, 28 Apr 2010 19:28:05 +0000
Re: Plotting a 3d ocean temperature map
http://www.mathworks.com/matlabcentral/newsreader/view_thread/280756#740285
Roger Stafford
"Sarah Bonham" <eesb@leeds.ac.uk> wrote in message <hr9vpc$7cr$1@fred.mathworks.com>...<br>
> Hi, <br>
> I am trying to plot a 3d image from a netcdf file using the variable temp_ym_dpth, which is ocean temperatures with depth.<br>
> <br>
> The matrix is 3D: 20x144x288 (depth x long x lat). <br>
> <br>
> I would like to plot a 3d profile of the Pacific, from 100E300E and 90S90N with depths 1 to 20.<br>
> <br>
> So far I have tried surf(squeeze(temp_ym_dpth)) but it returns the error: <br>
> <br>
> CData must be an MbyN matrix or MbyNby3 array<br>
> error in > surf at 97<br>
> hh = double(graph3d.surfaceplot(args(:),'parent',parax));<br>
> <br>
> I also tried defining the region first, but that didn't work either.<br>
> <br>
> I typed ndim to check the dimensions in case it was 4D, but it is 3D.<br>
> <br>
> I apologise if this is a simple question; I haven't been using matlab for long, but is there another way of producing a 3D image or could anyone tell me where I am going wrong?<br>
> <br>
> any help is greatly appreicated;<br>
> <br>
> thank you in advance,<br>
> <br>
> Sarah<br>
<br>
I'm not sure what you want to see when you say "a 3d profile of the Pacific". The 'surf' function will allow you to show the temperature at a fixed depth as longitude and latitude vary over that range, or it would allow, say, temperature at a fixed latitude and varying longitude and depth. I don't know any way us poor deficient human beings can see a display of temperature as three different variables change independently. Do you? Any attempt to superimpose a number of the above types of display would produce a very bewildering picture.<br>
<br>
Roger Stafford