Hi, In a 3D matrix, I have 4 sub-matrices of 3×3, like A below
A=[1 2 nan; 2 5 nan; 4 2 nan];A(:,:,2)=[3 4 5; 4 nan nan; 2 3 4];A(:,:,3)=[8 nan nan; 1 nan nan; 8 nan nan];A(:,:,4)=[1 2 3; 6 7 8; 3 3 5];
I need a new matrix that EXCLUDES the cases where the columns of A are ALL nan. In the case above submatrices A1 and A3 should be excluded, and the new matrix, say B, should be
B(:,:,1)=[3 4 5; 4 nan nan; 2 3 4];B(:,:,2)=[1 2 3; 6 7 8; 3 3 5];
I'd also need the id of the sub-matrices of A to be finally used in B, in this case 2 and 4.
Let me know if it's not clear thanks
Best Answer