Getting rid of NaN from 1 by n matrix

조회 수: 6 (최근 30일)
Nathaniel
Nathaniel 2012년 6월 8일
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에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by