필터 지우기
필터 지우기

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 CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by