Find overlap percentage of two plots

7 ビュー (過去 30 日間)
S
S 2024 年 8 月 4 日
コメント済み: S 2024 年 9 月 3 日
I am trying to find the percentage of points that overlap in two stem plots. I saw an answer on here using the mean to compare this, but I want to know overlap not average. How would I go about doing this for a simple plot.
ex:
input_signal = sin(2*pi*100*t) + sin(2*pi*300*t);
output_signal = FiltBank(input_signal);
Thank you for your time!

回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 8 月 5 日
編集済み: Walter Roberson 2024 年 8 月 5 日
It is not clear to me that it makes sense to talk about "overlap" for stem plots. stem plots do not have any inherent dot size, so points are either exactly the same or they are not.
If you want to test whether points are exactly the same,
mean(input_signal == output_signal) * 100
However, it would probably be better to use
TOLERANCE = 1e-8;
mean( abs(input_signal - output_signal) < TOLERANCE) * 100
  1 件のコメント
S
S 2024 年 9 月 3 日
@Walter Roberson Thanks! I am using a line plot now, but just trying to see where the graphs are overlapped, not necessarily how close the mean values of the two are. Is that possible?

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

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by