So i got a matrix A with 2 columns and 10 rows for example, with numbers and NaN's:
I want to calculate for each column of A the maximum number of consecutive NaN's, so the result would be like
I saw this code for a vector, but in my case since i got multiple columns doesnt quite do what i want
nanLocations = isnan(A)
props = regionprops(nanLocations, 'Area', 'PixelIdxList');
for k = 1 : length(props)
fprintf('Region #%d has length %d and starts at element %d and ends at element %d\n',...
k, props(k).Area, props(k).PixelIdxList(1), props(k).PixelIdxList(end));