plotting sin wave signal

조회 수: 12 (최근 30일)
Jimmy W
Jimmy W 2017년 4월 10일
댓글: Jimmy W 2017년 4월 10일
Hi, I have the following signal, f(t) = sin(t), -(pi/2)<= t <= (pi/2), what is the code to plot it for three whole periods? Thank you for the help!
  댓글 수: 1
Jimmy W
Jimmy W 2017년 4월 10일
편집: Walter Roberson 2017년 4월 10일
Basically I can only see one cycle after I plot it using these codes:
clc
clear all
x = linspace(-pi/2 , pi/2);
y = abs(sin(x));
plot(x,y);

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 4월 10일
You defined -(pi/2)<= t <= (pi/2) . Your function does not have a definition outside of that one period, so it is not meaningful to plot it for multiple periods.
You could extend your definition:
x = linspace(-pi/2 , 5*pi/2);

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by