|
"Sarah Bonham" <eesb@leeds.ac.uk> wrote in message <hr9vpc$7cr$1@fred.mathworks.com>...
> Hi,
> I am trying to plot a 3d image from a netcdf file using the variable temp_ym_dpth, which is ocean temperatures with depth.
>
> The matrix is 3D: 20x144x288 (depth x long x lat).
>
> I would like to plot a 3d profile of the Pacific, from 100E-300E and 90S-90N with depths 1 to 20.
>
> So far I have tried surf(squeeze(temp_ym_dpth)) but it returns the error:
>
> CData must be an M-by-N matrix or M-by-N-by-3 array
> error in -> surf at 97
> hh = double(graph3d.surfaceplot(args(:),'parent',parax));
>
> I also tried defining the region first, but that didn't work either.
>
> I typed ndim to check the dimensions in case it was 4D, but it is 3D.
>
> 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?
>
> any help is greatly appreicated;
>
> thank you in advance,
>
> Sarah
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.
Roger Stafford
|