multiply a sawtooth wave form and sin wave together

5 vues (au cours des 30 derniers jours)
Andrew Bills
Andrew Bills le 12 Avr 2019
Commenté : Andrew Bills le 13 Avr 2019
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;

Réponse acceptée

Mark Sherstan
Mark Sherstan le 12 Avr 2019
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 commentaire
Andrew Bills
Andrew Bills le 13 Avr 2019
Thank you so much. The website stack overflow is useless. I'm so thankfull for other fourms.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by