Transpose on ND array is not defined. Use PERMUTE instead.

1 次查看(过去 30 天)
Hello, I'm trying to convert a .mat file in to netcdf but stuck with the following error Transpose on ND array is not defined. Use PERMUTE instead. Any help would be much appreciated.
input_file= 'tp2d.mat'
output_file='tp2d.nc'
status=system(['rm ',' ',output_file])
ny=508
nx=449
nz=32
load 'tp2d.mat'
nccreate(output_file,'depth','Dimensions',{'r',nx,'c',ny,'z',nz},'Format','classic')
depth=Tp;
sizeofdepth=size(depth)
sizeofdepth =
508 449 32
ncwrite(output_file,'depth',depth')
Error using '
Transpose on ND array is not defined. Use PERMUTE instead.

采纳的回答

Walter Roberson
Walter Roberson 2018-4-8
ncwrite(output_file,'depth', permute(depth, [2 1 3]))

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by