Help me plz, Empty matrix!

2 ビュー (過去 30 日間)
lina
lina 2014 年 5 月 9 日
回答済み: Roberto 2014 年 5 月 9 日
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 件のコメント
lina
lina 2014 年 5 月 9 日
to Retrieve data from a netCDF variable its a function from NETCDF tool box
dpb
dpb 2014 年 5 月 9 日
編集済み: dpb 2014 年 5 月 9 日
I can't find any Matlab functions of those names--nor is there any TMW NETCDF Toolbox listed at the TMW web site.
This must be either Octave maybe or something from File Exchange or a vendor package???
So far, it doesn't seem to be a Matlab question.

サインインしてコメントする。

採用された回答

Roberto
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 件)

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by