remove all rows that contain nan matlab code example Example: remove nan matlab % Old B = A(~isnan(A)) % 2018b and above rmmissing(A)