Réponses (3)

Star Strider
Star Strider le 5 Juin 2019
Just for fun, other options are:
t = linspace(0,10,250);
f = 100;
sqwv = sum(sin(2*pi*(1:2:27)'*t*f)./((1:2:27)'));
figure
subplot(2,1,1)
plot(t, sqwv)
ylim([-1.5 1.5])
title('Sum-of-sines')
subplot(2,1,2)
plot(t, sign(sin(2*pi*f*t)))
ylim([-1.5 1.5])
title('sign-of sine')
drawing square sinusoidal functions - 2019 06 05.png

2 commentaires

Adam Danz
Adam Danz le 5 Juin 2019
Modifié(e) : Adam Danz le 5 Juin 2019
The sign of sine is a nice approach. (+1)
Star Strider
Star Strider le 5 Juin 2019
Thank you!

Connectez-vous pour commenter.

Gordon Odira
Gordon Odira le 5 Juin 2019

0 votes

COommunications.PNG

2 commentaires

Gordon Odira
Gordon Odira le 5 Juin 2019
How do i draw that function
Star Strider
Star Strider le 5 Juin 2019
The ‘sum-of-sines’ code approximates it.

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Commenté :

le 5 Juin 2019

Community Treasure Hunt

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

Start Hunting!

Translated by