indices on left not compatible with size of the right
1 回表示 (過去 30 日間)
古いコメントを表示
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
2018 年 10 月 23 日
Upload your code I mean everything with all the input datas , saves time
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Time Series Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!