Remove NaN and create one column

1 回表示 (過去 30 日間)
Damith
Damith 2014 年 7 月 3 日
コメント済み: Damith 2014 年 7 月 4 日
Hi,
I have a matrix A (31 x 12) which has NaN values and need to remove all NaN values and make it a one column (:). How can I do it MATLAB?
  1 件のコメント
per isakson
per isakson 2014 年 7 月 4 日
編集済み: per isakson 2014 年 7 月 4 日
Delete one of your two nearly identical questions!

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

採用された回答

per isakson
per isakson 2014 年 7 月 4 日
"I have this matrix A and has NaN values. I need
  1. to remove NaN values from all the columns and
  2. write the values into one column (:)."
Step one is not possible because it would result in columns with different length.
Switching the order of the steps will return a result
A = A(:);
A( isnan( A ) ) = [];
  1 件のコメント
Damith
Damith 2014 年 7 月 4 日
Thanks a lot. It worked. This is the result I wanted.

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

その他の回答 (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