Hi!
I have a 3D matrix of many rows. At som places there is NaN values in the middle of some rows that I don't want there, ex:
A(:,:,1) = [8 8; 9 9; 8 8; 9 9; NaN NaN; 1 1; 2 2; 3 3; 5 5; 7 7];
A(:,:,2) = [2 2; 3 3; 4 4; NaN NaN; NaN NaN; 1 2; 2 5; 3 7; 5 6; 7 8];
I want to remove the NaN's somehow. But since it is a 3D matrix it has to remain the same size and hence I can't just remove all NaN's by setting A(any(any(isnan(A),3),2),:,:) = [].
Best Answer