Beginner MATLAB question (I just started using matlab a week ago)

2 vues (au cours des 30 derniers jours)
Matthew Worker
Matthew Worker le 27 Jan 2019
Commenté : Rena Berman le 12 Mar 2020
Please help give the function to solve this. Thank you
  2 commentaires
Rena Berman
Rena Berman le 16 Jan 2020

(Answers Dev) Restored edit

Rena Berman
Rena Berman le 12 Mar 2020

(Answers Dev) Restored edit

Connectez-vous pour commenter.

Réponse acceptée

Stephen23
Stephen23 le 27 Jan 2019
Modifié(e) : Stephen23 le 27 Jan 2019
Simpler and more efficient to use logical indexing:
idx = ss(:,1)==1;
out = ss(idx,2)
If you really want to use |find|:
idy = find(ss==1);
out = ss(idy,2)
Basic MATLAB concepts, such as how to use indexing, are explained in the introductory tutorials:

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by