Indexing of an array

1 Ansicht (letzte 30 Tage)
galben
galben am 20 Okt. 2022
Kommentiert: galben am 22 Okt. 2022
I have a result array of 50 x 50 and i would like to extract all information for when a certain column equal a certain result.
  1 Kommentar
David Hill
David Hill am 20 Okt. 2022
Hard to understand what you are asking. A simple example would be beneficial.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Matt J
Matt J am 20 Okt. 2022
Bearbeitet: Matt J am 20 Okt. 2022
Simplified example:
array=randi(10,5)
array = 5×5
10 10 7 2 4 4 7 10 7 10 1 8 4 2 7 3 7 10 5 5 9 7 10 10 2
test=array(:,5)>4;
subset=array(test,:) %rows where 5th column is greater than 4
subset = 3×5
4 7 10 7 10 1 8 4 2 7 3 7 10 5 5
  1 Kommentar
galben
galben am 22 Okt. 2022
thanks this worked well

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by