Hi !
I ask you for help in Matlab in order to reduce a 3D array. In column there is three numbers (X,Y,Z coordinates) and each row corresponds to a different point. But these points have to respect a certain condition, otherwise three NaN are stored instead of the coordinates. The third dimension correspond to the time evolution of the coordinates stored in the 2D array.
For exemple:
A(:,:,1) = 1 2 3 NaN NaN NaN NaN NaN NaNA(:,:,2) = NaN NaN NaN 1 2 3 NaN NaN NaNA(:,:,3) = NaN NaN NaN NaN NaN NaN NaN NaN NaN
If I try:
A(any(any(isnan(A),3),2),:,:) = [];
I get:
Empty array: 0-by-3-by-3
Or I would have:
A(:,:,1) = 1 2 3 NaN NaN NaNA(:,:,2) = NaN NaN NaN 1 2 3A(:,:,3) = NaN NaN NaN NaN NaN NaN
The array is reduced but the shape is the same and I don't lose informations.
Thank your for your help and have a nice day !
Best Answer