indices on left not compatible with size of the right

1 vue (au cours des 30 derniers jours)
aine gormley
aine gormley le 23 Oct 2018
Commenté : aine gormley le 23 Oct 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 commentaires
madhan ravi
madhan ravi le 23 Oct 2018
Upload your code I mean everything with all the input datas , saves time
aine gormley
aine gormley le 23 Oct 2018
hi, thanks - i have done that now

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Time Series Objects dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by