help create a positive sin wave

조회 수: 6 (최근 30일)
Viswajit Talluru
Viswajit Talluru 2022년 10월 5일
댓글: Star Strider 2022년 10월 6일
Hey! need help creating a positive sin wave
  댓글 수: 2
Jan
Jan 2022년 10월 5일
What exactly do you call a "positive sine wave"?
John D'Errico
John D'Errico 2022년 10월 6일
A positive sine wave is one who always thinks of the glass as being half full. Of course. ;-)
My guess is Star has the answer, by translating the curve up by a constant. Only a guess though.

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

답변 (2개)

Star Strider
Star Strider 2022년 10월 5일
Perhaps —
syms t
positive_sine = sin(2*pi*t) + 1
positive_sine = 
figure
fplot(positive_sine, [0 5])
grid
ylim([-1 3])
hold on
yline(0,':k', 'LineWidth',1.5)
hold off
  댓글 수: 2
Viswajit Talluru
Viswajit Talluru 2022년 10월 6일
thank you for the help.
Star Strider
Star Strider 2022년 10월 6일
My pleasure!

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


Sam Chak
Sam Chak 2022년 10월 6일
Sounds intriguing. Are you looking for the half-wave rectified sine wave?
x = -2:0.01:2;
y1 = sin(pi*x); % full sine wave
y2 = sin(pi*x).*heaviside(sin(pi*x)); % half-wave rectified sine wave
plot(x, y1, '--'), hold on,
plot(x, y2, 'linewidth', 1.5), grid on, ylim([-1.5 1.5])

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by