Generate 3D plots using 3D variables (Lat,lon,depth,Salinity)
26 views (last 30 days)
Francesca Evans on 7 Sep 2022
I've converted 4D-double variables from netCDF files and have these variables (i.e., temperature/salinity) in a three-dimensional double format (lon x lat x depth), I used [x y z ] = meshgrid(lon,lat,depth) in order to make each variable the same size. Each variable is a double, and looking at the forums and mathworks, I should be able to generate 3D plots (i.e., surfc/contour3). However, when I attempt to use these plot formats, I get errors such as X,Y,Z vectors must be the same length (which they are after using meshgrid?), or 'values must be scalar, vector or an array of numeric type' but again, after using TF = isnumeric(variable), each parameter used gets ans (1).
I've tried using the lon, lat and depth variables as they come (not meshgridded), but then I get errors with matrix dimensions must agree.
Does anyone know how to resolve these issues?