フィルターのクリア

indices on left not compatible with size of the right

1 回表示 (過去 30 日間)
aine gormley
aine gormley 2018 年 10 月 23 日
コメント済み: aine gormley 2018 年 10 月 23 日
Dear Community, I am hoping somebody can advice on the error below that I keep hitting with a new code:
Unable to perform assignment because the indices on the left side are not
compatible with the size of the right side.
Error in ms_manip (line 38)
[~, pol_lat(i), pol_lon(i)] = mf_srex(lat_mod, lon_mod, PRECT_ctl, area, island, [], srex_reg{i}); %#ok<*SAGROW>
Here is the full code the error refers to:
% get grid dimensions
[nlat, nlon] = size(lat_mod);
% get number of srex regions
nreg = length(srex_reg);
% get land pixel indices - excluding Antarctica
island = pct_land > 50;
island(lat_mod < -60) = 0; % remove antarctica
% get land pixel indices - excluding Antarctica
isirr = pct_irr > 10;
isirr(lat_mod < -60) = 0; % remove antarctica
% create date vectors
date_vec = datevec(datenum(time_begin):1:datenum(time_end));
% get corners of SREX regions used in this study and use them to generate srex masks
for i=1:nreg
[~, pol_lat(i), pol_lon(i)] = mf_srex(lat_mod, lon_mod, PRECT_ctl, area, island, [], srex_reg{i}); %#ok<*SAGROW>
issrex(:,:,i) = inpolygon(lon_mod, lat_mod, pol_lon{i}, pol_lat{i}) & island;
end
The above code was working previously before the variable 'area' was added - but the code (with the new variable) is working fine elsewhere. The units also seem fine. Please help
  2 件のコメント
madhan ravi
madhan ravi 2018 年 10 月 23 日
Upload your code I mean everything with all the input datas , saves time
aine gormley
aine gormley 2018 年 10 月 23 日
hi, thanks - i have done that now

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series Objects についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by