I have a variable “fi”, which stores a global grid of elevations (units: meters), and another variable “DL” that stores 26 depth levels. Below are my scripts for creating some land/sea masks:
function f1(fi, DL)
A = [];
for i in 1:length(DL)
B = fi .> -DL[i];
A = [A, B];
end
A
end
L0 = f1(fi, DL);
When I checked the created mat file in Matlab, I encountered multiple issues. Would anyone please help?
-
Why does my L0{1} give me the below answer, when it should be a grid of zeros and ones? BTW, my L0{2} gives me the correct grid.
2×1 cell array
{ 2×1 cell }
{1440×720 logical} -
Why does L0 only contains two grids, instead of the 26 grids the loop produces?
Many thanks!