Filter löschen
Filter löschen

indices on left not compatible with size of the right

1 Ansicht (letzte 30 Tage)
aine gormley
aine gormley am 23 Okt. 2018
Kommentiert: aine gormley am 23 Okt. 2018
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 Kommentare
madhan ravi
madhan ravi am 23 Okt. 2018
Upload your code I mean everything with all the input datas , saves time
aine gormley
aine gormley am 23 Okt. 2018
hi, thanks - i have done that now

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Time Series Objects finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by