Subscript indices must either be real positive integers or logicals. Error in jl (line 51) u = u(i,j,k)
Info
This question is closed. Reopen it to edit or answer.
Show older comments
i = lat;
j = long;
k = 1:length(1979:2012);
u = u(i,j,k)
yrlst = 1979:2012;
wintlst = 1:3;
for i = 1:length(yrlst)
tempwint = wintlst +(i-1)*12
tmpu = squeeze(nanmean(u(:,:,tempwint),3));
tmpv = squeeze(nanmean(v(:,:,tempwint),3));
for j = 1:size(tmpu,1)
k = 1:size(tmpu,2)
tuwint(j,k,i) = tmpu(j,k);
tvwint(j,k,i) = tmpv(j,k);
end
end
Answers (1)
Walter Roberson
on 8 Sep 2015
One of your values for lat or long is not a positive integer.
find(lat < 1 | lat ~= fix(lat))
find(long < 1 | long ~= fix(long))
3 Comments
Sophia
on 10 Sep 2015
Walter Roberson
on 10 Sep 2015
Whatever defined your "lat" and "long" needs to define your "u"
Sophia
on 10 Sep 2015
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!