Getting rid of NaN from 1 by n matrix

1 次查看(过去 30 天)
The matrix looks like this
[1,2,3,4,5,6,7,NaN,NaN......NaN]
The NaN are at the end of the matrix.
How do I get rid of those and turn this matrix into [1,2,3,4,5,6,7]?

采纳的回答

Ryan
Ryan 2012-6-8
A =[1,NaN,2,3,NaN,4,5,NaN,6,7,NaN,NaN];
A(isnan(A)) = [];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by