ranges of dimensions when using nan
1 回表示 (過去 30 日間)
古いコメントを表示
dear community,
I have a 6D result Arr(crb, cefb, crr, crp, ctb, ccb) where Arr(Arr>1)=nan.
How can I find the values of crb, cefb, crr, crp, ctb and ccb, where Arr is not nan?
thanks
3 件のコメント
採用された回答
Jan
2021 年 5 月 24 日
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.
3 件のコメント
Jan
2021 年 5 月 25 日
isnan() replies an array of the same size as the input. So if the input has 6 dimensions, the output has 6 dimensions, too.
Please post a piece of code, which reproduces your problem.
ind2sub converts the linear index to the indices related to an array. See: doc ind2sub.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!