필터 지우기
필터 지우기

can anybody explain the commented line of the code

조회 수: 3 (최근 30일)
N/A
N/A 2019년 2월 13일
댓글: Nathan Mugge 2021년 12월 6일
fs = 512;
X = [-2 1 -3 5 -1 3 -4 4 -2];
lX = length(X)-1;
Y = -diff(X)/2.*cos(pi*(0:1/fs:1-1/fs)') + (X(1:lX)+X(2:lX+1))/2;
% Y = [Y(:);X(end)];
plot(0:lX,X,'o',0:1/fs:lX,Y)
  댓글 수: 2
madhan ravi
madhan ravi 2019년 2월 13일
Are you asking the purpose of it or what the syntax does?
Nathan Mugge
Nathan Mugge 2021년 12월 6일
What the syntax does

댓글을 달려면 로그인하십시오.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 2월 13일
편집: madhan ravi 2019년 2월 13일
Are you asking this commented line?
% Y=[Y(:);X(end)];
Y(:) represents column vector having all elements (:)
X(end) represents the end element of X
New Y creates the all Y elements and last element of X.
See the following example for better understanding
>> X = [-2 1 -3 5 -1 3 -4 4 -2]
X =
-2.00 1.00 -3.00 5.00 -1.00 3.00 -4.00 4.00 -2.00
>> Y=[1 2 3 4 5 6 7 8 9]
Y =
1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00
>> Y=[Y(:);X(end)]
Y =
1.00
2.00
3.00
4.00
5.00
6.00
7.00
8.00
9.00
-2.00
  댓글 수: 3
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 2월 13일
편집: KALYAN ACHARJYA 2019년 2월 13일
Transpose Y (use ')
X =
-2.00
1.00
-3.00
5.00
-1.00
3.00
-4.00
4.00
-2.00
>> X=X'
X =
-2.00 1.00 -3.00 5.00 -1.00 3.00 -4.00 4.00 -2.00

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Vibration Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by