how to display all non NaN values in a matrix

344 ビュー (過去 30 日間)
Nancy
Nancy 2012 年 2 月 15 日
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 Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by