フィルターのクリア

how to interpret this expression?

4 ビュー (過去 30 日間)
KJDS SRINIVASA RAO
KJDS SRINIVASA RAO 2013 年 5 月 23 日
Could you please put the braces for this expression. I mean does this expression mean
a) a( N - winLength * 2 : N )=0; this
1) a( N - ( winLength * 2 ) : N ) = 0; or
2) a( ( N - winLength ) * 2 : N ) = 0;
n the same with this expression also
b) a ( 1 : winLength * 2 ) = 0;
1) a ( 1 : ( winLength * 2 ) ) = 0; or
2) a ( (1 : winLength ) * 2 ) = 0;

採用された回答

David Sanchez
David Sanchez 2013 年 5 月 23 日
Let us suppose
a = [1 2 3 4 5 6 7 8]; winLength = 3; N = 7;
- a( N - winLength * 2 : N )=0 -> elements from N-winLength*2 till element N is zero: N-winLength*2 = 7-3*2=1 -> a(1:7)=0 a = [0 0 0 0 0 0 0 8]
- a( N - ( winLength * 2 ) : N ) = 0 -> same than above
- a( ( N - winLength ) * 2 : N ) = 0 -> (N-winLength)*2=(7-3)*2 =4*2=8 -> a(8:7) -> this produces an empty matrix for the example presented, but I'm sure you can think about any other example.
- a(1:winLength*2) = 0 is the same than a(1:(winLength*2)) = 0 -> a(1:3*2) = a(1:6) = [1 2 3 4 5 6]
- a((1:winLength)*2) = a((1:3)*2) = a(1:3)*2 = [2 4 6]
  1 件のコメント
KJDS SRINIVASA RAO
KJDS SRINIVASA RAO 2013 年 5 月 24 日
Thanks for your help

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by