フィルターのクリア

Meaning of a sentence in a code

1 回表示 (過去 30 日間)
Raj Arora
Raj Arora 2021 年 12 月 16 日
編集済み: KSSV 2021 年 12 月 16 日
M=3;n=0:30*M-1;
m=0:29;
x=sin(2*pi*0.04*n);
% y=x([1:M:length(x)]);
  1 件のコメント
Raj Arora
Raj Arora 2021 年 12 月 16 日
meaning of commented line?

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

採用された回答

KSSV
KSSV 2021 年 12 月 16 日
編集済み: KSSV 2021 年 12 月 16 日
You can know it by your self. Just take a print of the values.
M=3;
n=0:30*M-1;
m=0:29;
x=sin(2*pi*0.04*n);
idx = 1:M:length(x) % generate indices picking every third element of array
idx = 1×30
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88
y=x(idx) % extract the elements
y = 1×30
0 0.6845 0.9980 0.7705 0.1253 -0.5878 -0.9823 -0.8443 -0.2487 0.4818 0.9511 0.9048 0.3681 -0.3681 -0.9048 -0.9511 -0.4818 0.2487 0.8443 0.9823 0.5878 -0.1253 -0.7705 -0.9980 -0.6845 -0.0000 0.6845 0.9980 0.7705 0.1253

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by