Extract certain rows from matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Andrew Newell
2015년 3월 6일
편집: Andrew Newell
2015년 3월 6일
Assuming you read the other data file into another_matrix, the answer is
extracted_data = another_matrix(loc);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!