multiply a sawtooth wave form and sin wave together

2 次查看(过去 30 天)
Me and my friend are trying to multiply the sawtooth wave form and sin wave together. could someone help us with this command below is a photo of the multisim file we are try to recreate in matlab.
x = sawtooth(2*pi*50*t);
x1 = sin(pi/4*t+pi/2);
z=x.*x1;

采纳的回答

Mark Sherstan
Mark Sherstan 2019-4-12
You just need to define a time array. This should work for you:
t = 0:pi/12:2*pi;
x = sawtooth(2*pi*50*t);
x1 = sin(pi/4*t+pi/2);
z=x.*x1;
plot(t,x,t,x1,t,z)
legend('sawtooth','sine wave','combined')
  1 个评论
Andrew Bills
Andrew Bills 2019-4-13
Thank you so much. The website stack overflow is useless. I'm so thankfull for other fourms.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by