how to discard NaN vectors from a 3D matrix

조회 수: 2 (최근 30일)
Itzik Ben Shabat
Itzik Ben Shabat 2013년 11월 20일
Hi, I have a 3D matrix. some of its rows/columns/depth vectors can be all NaN. I wish to creat a new matrix which is the same as the original one only without the NaNs. is there a function that can help me do this ? in 2D i used ismember and just substitute them with []. but for the 3D case im stuck. here is an example code of such matrix
mat=ones(6,6,6);
mat(1:2,:,:)=NaN(2,6,6);
NANLoc=isnan(mat);
( so I want mat(3:6,:,:) as a new matrix)
any ideas? thanks

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by