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

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?

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 17 de Mayo de 2014
Editada: Azzi Abdelmalek el 17 de Mayo de 2014
a = [.2 , .3 , 2 , 5 , .7 , 8]
b=a(a<=1)

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Preguntada:

el 17 de Mayo de 2014

Editada:

el 17 de Mayo de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by