Effacer les filtres
Effacer les filtres

Integrating across 2 grids

3 vues (au cours des 30 derniers jours)
Tim Holgate
Tim Holgate le 19 Fév 2021
Commenté : darova le 20 Fév 2021
I'm having issues with the integral function requiring floating point scalars instead of gridded data. In the code below, I wish to integrate between sea_surface and january_mld_int (everything is gridded in 38X1388 arrays)
%% Mixed Layer Freshwater Function (prior to integrating across mixed layer)
sea_surface=zeros(38,1388); %makes a grid of zeroes to integrate from/to
jan_fun=@(x)((january_ref_sal-january_mld_int)/january_ref_sal)*x; %makes the formulae as defined in parampil 2010 jan_fwf=integral(jan_fun,sea_surface,january_mld_int,'ArrayValued',true);%attempts to integrate
where january_mld_int is the interpolated MLD data, and jan_ref_sal is the reference salinity (both 38x1388 grids)
However, Integral requires floating point vectors, not arrays!
Any help for this issue?
  2 commentaires
darova
darova le 20 Fév 2021
Can't you add zeros after dot?
2.0
3.0
...
darova
darova le 20 Fév 2021
Can't you add zeros after dot?
2.0
3.0
...

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Econometrics Toolbox dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by