how do i find the matching data for locs when using findpeaks()

2 ビュー (過去 30 日間)
chengwei zhang
chengwei zhang 2020 年 2 月 5 日
コメント済み: chengwei zhang 2020 年 2 月 5 日
Hi
I am using the function
[pks,locs]=findpeaks()
and the locs returns the position of that pks in the data when plotting
but what I want is plotting the pks and the other coloum in the data not the locs as the x-axis
thanks in advance
  2 件のコメント
KSSV
KSSV 2020 年 2 月 5 日
What do you mean by plotting the pks and the other coloum in the data?
chengwei zhang
chengwei zhang 2020 年 2 月 5 日
in the CeramicRe.txt, there are two coloums of data, the one on the right side is the pks and the left side is time, but the code i used only return the pks with its position number in the data but i want to plot the pks vs. time

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

採用された回答

Adam Danz
Adam Danz 2020 年 2 月 5 日
編集済み: Adam Danz 2020 年 2 月 5 日
If your peaks plot is produced by
plot(time, data)
and you're locating the peaks with
[pks,locs]=findpeaks(data);
Then, to plot the peaks as a function of time,
plot(time(locs), pks, '*')
  1 件のコメント
chengwei zhang
chengwei zhang 2020 年 2 月 5 日
thank you very much. you just saved my life :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by