a = [NaN 1 2 3 4];
p = find(isnan(a))
a(p) = [];
matlab 把数组中的NaN去除掉
原文:https://www.cnblogs.com/francischeng/p/9470159.html