Duplicating part of a matrix

1 vue (au cours des 30 derniers jours)
Michael
Michael le 22 Nov 2014
Commenté : Michael le 22 Nov 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 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 22 Nov 2014
there is no a specific command for a general question, can you post an example?

Connectez-vous pour commenter.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by