deleting n entries in matlab

2 views (last 30 days)
ali hassan
ali hassan on 12 Feb 2022
Edited: Matt J on 12 Feb 2022
if a=[1 nan 4 nan 4 3 ]
how can i delete all nan entries here such that it becomes:
a=[1 4 4 3]

Accepted Answer

Matt J
Matt J on 12 Feb 2022
Edited: Matt J on 12 Feb 2022
a=[1 nan 4 nan 4 3 ];
a=a(~isnan(a))
a = 1×4
1 4 4 3

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!