フィルターのクリア

find the intersection of two curves

13 ビュー (過去 30 日間)
tala
tala 2018 年 6 月 17 日
コメント済み: Ameer Hamza 2018 年 6 月 17 日
hello. i have 2 curves which are drawn amplitude against samples. how can i find the intersection of samples in 2 curves? i mean i want to find that which samples of 2 curves have same amplitudes each of curves are the size 1*53
load s1w; load s2w;
plot (s1w,'.b-'); hold on; plot (s2w,'.r-');

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 6 月 17 日
Since samples of s1w and s2w are not exactly equal, you will need to define a tolerance value to find the point of intersection i.e. how much difference between value can still be treated as equal. In this case, following is one of the possible solutions
tol < 0.1; % change tolerance as required.
index = abs(s1w-s2w) < tol;
indexNumeric = find(index);
this will give you index from both vectors where values are almost equal.
  2 件のコメント
tala
tala 2018 年 6 月 17 日
really thanks sir, it works for me
Ameer Hamza
Ameer Hamza 2018 年 6 月 17 日
You are welcome.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Signal Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by