how to display all non NaN values in a matrix

372 次查看(过去 30 天)
Hi,
I have an array that looks like
A= [NaN 1 3 NaN NaN 5 NaN NaN 6];
what function should I run to make it look like this
A=[1 3 5 6];
Thanks Nancy

回答(1 个)

G A
G A 2012-2-15
A=(A(~isnan(A)));

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by