MATLAB: Deleting nan rows in a matrix

nan

Hi,
is there a simple method to delete the rows in which there is a nan in a matrix? I wrote the codes this way: [x1,y1]=find(isnan(AR1)); x1b=unique(x1); AR1(x1b,:)=[];
but I feel that I can delete these rows in a simpler way.

Best Answer

AR1(any(isnan(AR1),2),:) = [];