Remove Empty Values from a nx1 Vector of doubles
12 views (last 30 days)
Show older comments
R = [1, 2, , 4, 5, , 7, , , , ,12 ];
I would like to remove all the blank values.
I have tried cellfun('isempty') and I get an error that this is only applicable to cells.
I have also tried R = R('isempty')
R = R(~'isempty)
2 Comments
the cyclist
on 27 Mar 2020
Edited: the cyclist
on 27 Mar 2020
There cannot be "blank" values in a variable of type double. Can you post functioning MATLAB code that defines what you actually have? (Your code above does not, of course.)
Stephen23
on 27 Mar 2020
"Remove Empty Values from a nx1 Vector of doubles"
All numeric array elements have a value, they cannot be "empty".
If you want help you will have to provide us with actual data or a more accurate description of your data.
Answers (1)
Srivardhan Gadila
on 30 Mar 2020
An array can't have an empty value. The whole array itself should be empty.
You can refer to:
0 Comments
See Also
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!