how to do the data extraction data from a 3D matrix

조회 수: 1 (최근 30일)
Lilya
Lilya 2018년 10월 7일
댓글: Lilya 2018년 10월 7일
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
Lilya
Lilya 2018년 10월 7일
편집: Lilya 2018년 10월 7일
the final matrix should contains the specified result for each slice of the third column (10)
Lilya
Lilya 2018년 10월 7일
@Rik Wisselink
I do appreciate your response. thanks a lot

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2018년 10월 7일
mask = density_1000 >= 27.5 & density_1000 <= 28;
den = density_1000;
den(~mask) = nan;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by