Duplicating part of a matrix

1 visualización (últimos 30 días)
Michael
Michael el 22 de Nov. de 2014
Comentada: Michael el 22 de Nov. de 2014
Say I have a row vector, and I want to make another vector of all the values in the other one greater than some threshold. I can probably do this with an if inside a for loop, or something like that, but is there a specific command for this?
  1 comentario
Azzi Abdelmalek
Azzi Abdelmalek el 22 de Nov. de 2014
there is no a specific command for a general question, can you post an example?

Iniciar sesión para comentar.

Respuesta aceptada

the cyclist
the cyclist el 22 de Nov. de 2014
A = [1 2 3 4 5 6 7];
B = A(A>4);
  1 comentario
Michael
Michael el 22 de Nov. de 2014
Sweet! Just what I hoped for.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by