Remove NaN and create one column

1 次查看(过去 30 天)
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?

采纳的回答

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 ) ) = [];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 NaNs 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by