how to display all non NaN values in a matrix

조회 수: 349 (최근 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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by