I have a for loop of a certain number of days, we'll say 20. I created a logical matrix for points with a value less than or equal to 33. Each salinity point corresponds to a specific lat/long so the position that this value occurs is important. I want to loop through each day and essentially tally which days each point has a value less than 33.
for j = 1:20
if L = logical(salinity <=33)
Example: Let's say I have (3) 2x3 matrices
I want one matrix of the same size at the end of the loop that looks like this:
I can't get accumarray to work because I can't keep the tally of values in the same position in the matrix. If someone could show me how to do that, I think it would work. I'm also concerned about memory. Although I used 20 days as an example, I actually have decades of data to run, so I don't want each logical matrix saved in my workspace.