how to do the data extraction data from a 3D matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all,
I have a 3D matrix with a dimension of (251*28*10) that I want to extract a specific data from it. As the extracted data are not in the same dimension, the empty values should be NaNs the used loop is
for i = 1:10
for j = 1:28
density(:,:,i) = find(density_1000(:,j,i)>= 27.5 & density_1000(:,j,i)<=28);
den = density_1000 (density); % this should be the finle matrix of the extracted data (251*28*10)
end
end
Any help will be appreciated.
Thanks
4 件のコメント
採用された回答
Walter Roberson
2018 年 10 月 7 日
mask = density_1000 >= 27.5 & density_1000 <= 28;
den = density_1000;
den(~mask) = nan;
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!