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