Extract certain rows from matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Gareth Evans
am 6 Mär. 2015
Kommentiert: Gareth Evans
am 6 Mär. 2015
Hello,
I have extracted the peak data from a 1x86400 matrix in the workspace (named a) using the following command:
[pks,locs]=findpeaks(a)
This results in 'pks' = 1x14382 and the 'locs' positions for the obtained data (Also sized at 1x14382).
I would like to use the locations (locs) from the above to extract data from another 1x86400 data file (in this case named b).
Whats the best approach to do this?
0 Kommentare
Akzeptierte Antwort
Andrew Newell
am 6 Mär. 2015
Bearbeitet: Andrew Newell
am 6 Mär. 2015
Assuming you read the other data file into another_matrix, the answer is
extracted_data = another_matrix(loc);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!