Sliding window to calculate intra-window difference

7 ビュー (過去 30 日間)
Iram Shahzadi
Iram Shahzadi 2018 年 9 月 24 日
コメント済み: Adam Danz 2018 年 9 月 25 日
I have a matrix s=512*100*20 (with N=100). I want to implement sliding window of a width 2W+1 that is centered at position i to compute the intra-window difference s(i+w)-s(i-w) for every possible position. I have attached the algorithm. Anyone, please help me how to implement it in Matlab.

採用された回答

Adam Danz
Adam Danz 2018 年 9 月 24 日
The formula in the attachment is written below. I don't know what your value W is and I don't now how your variable N comes into play.
% deltaW = nan(?,?); %allocate your loop variable here after you know what its size should be.
for i = W : N-1-W
deltaW(i) = s(i+W) - s(i-W);
end
  5 件のコメント
Iram Shahzadi
Iram Shahzadi 2018 年 9 月 25 日
Thank you @Adam for your kind reply
Adam Danz
Adam Danz 2018 年 9 月 25 日
Glad I could help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by