how to allocate a matrix less than 1 to a variable?

4 views (last 30 days)
So lets say I have matrix a = [.2 , .3 , 2 , 5 , .7 , 8]
I want to allocate all values of a <= 1 to a variable b. so b should contain .2, .3, .7
How do I do this?

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 17 May 2014
Edited: Azzi Abdelmalek on 17 May 2014
a = [.2 , .3 , 2 , 5 , .7 , 8]
b=a(a<=1)

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices 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!