MATLAB Answers

Nancy
0

how to display all non NaN values in a matrix

Asked by Nancy
on 15 Feb 2012
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

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by G A
on 15 Feb 2012

A=(A(~isnan(A)));

  0 Comments

Sign in to comment.