Help me plz, Empty matrix!
3 次查看(过去 30 天)
显示 更早的评论
hi, I have this code
clc;clear all;close all
a=dir('*.nc');
for i=2:numel(a)
nc_cat('ts_oaflux_1958.nc',a(i).name);
end
f=nc_varget('ts_oaflux_1958-2012.nc','tmpsf');
d=find(f>30000);
f(d)=nan;
when I run it I get this error:
d =
Empty matrix: 0-by-1
please help me argent this is my final exam code :(
Thank u in advance.
3 个评论
采纳的回答
Roberto
2014-5-9
the 0 sized matrix means that non of the elements of f are greater than 30000, so if you want solve the problem, try this:
d=find(f>30000);
if any(d)
f(d)=nan;
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NetCDF 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!