How to find the difference of the maximum points between datasets

3 ビュー (過去 30 日間)
Ahmed Abdalazeez
Ahmed Abdalazeez 2019 年 1 月 21 日
コメント済み: Image Analyst 2019 年 1 月 21 日
Hi,
I have three data sets of sine waves, I am looking of the way to find the maximum points (only) for each dataset and then find the difference between them

回答 (2 件)

Image Analyst
Image Analyst 2019 年 1 月 21 日
Try
[max1, index1] = max(signal1);
[max2, index2] = max(signal2);
[max3, index3] = max(signal3);
% Difference between maximum amplitudes.
diff12 = abs(max1 - max2);
diff13 = abs(max1 - max3);
diff23 = abs(max2 - max3);
% Now diff between indexes
indexDiff12 = abs(index1 - index2);
indexDiff13 = abs(index1 - index3);
indexDiff23 = abs(index2 - index3);
  3 件のコメント
Ahmed Abdalazeez
Ahmed Abdalazeez 2019 年 1 月 21 日
what I want to do, is to find not only one msximum but the max for each peak for all dataset, I used findpeak, but it gives me several points, but indeed I need only the maximum point for each peak,,
thanks in advance
Image Analyst
Image Analyst 2019 年 1 月 21 日
Try passing each signal into findpeaks().

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


Kevin Phung
Kevin Phung 2019 年 1 月 21 日
if y1 is vector consisting of the y-values for your sinewave,
max(y1)
will return the max value. min(y1) will give you its minimum.

カテゴリ

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