drawing square sinusoidal functions

回答(3 个)

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 个评论

The sign of sine is a nice approach. (+1)

请先登录,再进行评论。

Gordon Odira
Gordon Odira 2019-6-5
COommunications.PNG

2 个评论

How do i draw that function
The ‘sum-of-sines’ code approximates it.

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by