フィルターのクリア

Extract certain rows from matrix

2 ビュー (過去 30 日間)
Gareth Evans
Gareth Evans 2015 年 3 月 6 日
コメント済み: Gareth Evans 2015 年 3 月 6 日
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?

採用された回答

Andrew Newell
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);
I suggest you read about Matrix indexing in MATLAB.
  1 件のコメント
Gareth Evans
Gareth Evans 2015 年 3 月 6 日
Thanks Andrew.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series Events についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by