ranges of dimensions when using nan
1 view (last 30 days)
Jan on 24 May 2021
isnan is the function, which replies a logical array with the same dimension as the input and TRUE values, where the input has NaN elements. It does handle 6 dimensional arrays.
siz = [2,3,4,5,6,7];
Data = ones(siz); % Some test data
Data(rand(siz) > 0.5) = nan;
index = isnan(Data)
Now use either the logical array directly, or call find() to obtain the index vectors. Maybe ind2sub helps you to get the indices for the different dimensions.