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

1 回表示 (過去 30 日間)
Mansur Ali Jisan
Mansur Ali Jisan 2018 年 4 月 8 日
コメント済み: Mansur Ali Jisan 2018 年 4 月 8 日
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