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