how to remove negative numbers from a vector
Show older comments
Hi,
Let
A=[5 -0.4 0.1 0 100 -10]
in that i want to remove all -ve numbers and print refined vector A
please help !!!! -kiran mukund-
Answers (1)
Use basic logical indexing:
>> A(A>=0)
ans =
5 0.1 0 100
Categories
Find more on Operators and Elementary Operations 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!