Clear Filters
Clear Filters

Isolate data elements out of a column on NaNs

1 view (last 30 days)
I have a large column of mostly "NaN" but it does periodically include actual data. Is there a way I can extract those data to form another vector?

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 6 Oct 2011
a=[0 nan 1 nan];
b=a(~isnan(a))

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!