Asked by Most. Nasrin Zahan
on 13 Aug 2018

wave_1

ans =

72 16 12

Error using .'

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

Error in interp2 (line 131)

V = V.';

Error in wave_1 (line 43)

slp_po_in = interp2(lonx,laty,slp, x_po_in, y_po_in,'linear');

% main code

clear;close all;

% use ncdisp(filename) to discover file contents...

lat=ncread('ds010.0.20130511.20130516.nc','lat');

lon=ncread('ds010.0.20130511.20130516.nc','lon');

slp=ncread('ds010.0.20130511.20130516.nc','slp');

size(slp)

[row, col] = size(slp);

slp_cen = 99999999999.9;

for icen = 1:length(slp)

for jcen = 1:length(slp)

if slp(icen,jcen)<slp_cen

slp_cen = slp(icen,jcen);

i_cen = icen;

j_cen = jcen;

end

end

end

[lonx,laty] = meshgrid(1:1:300,300:-1:1);

i_ceny = laty(i_cen,1);

j_cenx = j_cen;

lonx = lonx - j_cenx;

laty = laty - i_ceny;

%---wavenumber 1---sigma=0.9----r<100km-

rmax = 25;

rmin = 0.5;

thetad=2; %interpolate angle grid

disd =0.5 ; %interpolate grid

for idis = 1:1:((rmax-rmin)/disd+1)

for ith = 1:1:(360/thetad)

x_po_in(ith,idis) = ((idis-1)*disd+rmin)*cos((ith-1)*thetad*pi/180);

y_po_in(ith,idis) = ((idis-1)*disd+rmin)*sin((ith-1)*thetad*pi/180);

end

end

slp_po_in = interp2(lonx,laty,slp, x_po_in, y_po_in,'linear');

for i = 1:size(x_po_in,2)

slp_w1_in(:,i) = fft(slp_po_in(:,i),1,1);

slp_w1_in(:,i) = slp_w1_in(:,i) - sum(slp_w1_in(:,i))/180;

end

hold on

figure

[C1,h1] = contour(x_po_in,y_po_in, slp_po_in);

hold off;

Answer by Stephen Cobeldick
on 13 Aug 2018

Edited by Stephen Cobeldick
on 13 Aug 2018

Accepted Answer

Stephen Cobeldick
on 13 Aug 2018

Most. Nasrin Zahan
on 13 Aug 2018

Most. Nasrin Zahan
on 14 Aug 2018

Now, I solved my problem. Thanks a lot.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 2 Comments

## Stephen Cobeldick (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/414606-how-can-i-solve-transpose-on-nd-array-is-not-defined-use-permute-instead#comment_599038

## Most. Nasrin Zahan (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/414606-how-can-i-solve-transpose-on-nd-array-is-not-defined-use-permute-instead#comment_599039

Sign in to comment.