필터 지우기
필터 지우기

Plot a sinusoidal signal from an x(t) equation

조회 수: 6 (최근 30일)
collegestudent
collegestudent 2023년 1월 23일
댓글: Sulaymon Eshkabilov 2023년 1월 23일
I am working on solving this problem, however, when I run the code and try to plot it, nothing appears in the figure and no error is occuring. If anyone could provide assistance as to where I went wrong in this problem would be helpful. I have added my code below.
t = 0:0.1:1;
x = @(t) cos(2*pi*t-(pi/2));
Ts = 1/8; %seconds
x0 = x(0);
x1 = x(1);
x2 = x(2);
x3 = x(3);
x4 = x(4);
x5 = x(5);
x6 = x(6);
x7 = x(7);
x8 = x(8);
hold on
plot(t,x0)
plot(t,x1)
plot(t,x2)
plot(t,x3)
plot(t,x4)
plot(t,x5)
plot(t,x6)
plot(t,x7)
plot(t,x8)
hold off

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 1월 23일
편집: Sulaymon Eshkabilov 2023년 1월 23일
You need to plot this exercise this way:
Ts = 1/8; %seconds
t = 0:Ts:1;
x = @(t) cos(2*pi*t-(pi/2));
XX=x(t);
plot(t, XX, 'rd','MarkerSize', 9, 'MarkerFaceColor', 'y'), grid on
  댓글 수: 4
collegestudent
collegestudent 2023년 1월 23일
Thank you!
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 1월 23일
Most welcome!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by