How to calculate the difference between two Areas?

3 ビュー (過去 30 日間)
Gabriele Colasurdo
Gabriele Colasurdo 2019 年 11 月 20 日
編集済み: Ridwan Alam 2019 年 11 月 20 日
Hi.
I have two areas.
How can I obtain the difference between these two?
How can I then minimize the difference by translating the second area?
Or even better, how can I display the difference between areas as a funcion of the amont of translation done to the second area?
  4 件のコメント
Star Strider
Star Strider 2019 年 11 月 20 日
Code and data would be helpful.
Gabriele Colasurdo
Gabriele Colasurdo 2019 年 11 月 20 日
Sorry but what do you mean by code and data? :S

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

回答 (1 件)

Ridwan Alam
Ridwan Alam 2019 年 11 月 20 日
編集済み: Ridwan Alam 2019 年 11 月 20 日
If you just want to align those two profiles using angle values, then I would use findpeaks() on both and look at their differences.
% angle1, angle2 are arrays
[~,peaklocs1] = findpeaks(angle1); % add options such as "MinPeakDistance" and others as necessary
[~,peaklocs2] = findpeaks(angle2);
if peaklocs2(1)>peaklocs1(1)
alignment = peaklocs2(1) - peaklocs1(1)
else
alignment = peaklocs1(1) - peaklocs2(1)
end

カテゴリ

Help Center および File ExchangeSignal Generation and Preprocessing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by