フィルターのクリア

Getting rid of NaN from 1 by n matrix

1 回表示 (過去 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)) = [];
  1 件のコメント
Nathaniel
Nathaniel 2012 年 6 月 8 日
thank you!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by