Arbitrary periodic signal in Simulink

4 views (last 30 days)
Hari Zenga
Hari Zenga on 19 Sep 2014
Edited: Hari Zenga on 19 Sep 2014
Hi!
Is it possible to generate arbitrary periodic signal in Simulink? For example, I want to generate voltage signal [tex] e(t)= \sum_{n=1}^{\infty}\frac{2}{n}(-1)^{n+1}\sin{(nt)} [\tex] (Fourier series of sawtooth waveform). I wrote m-file to graph this voltage signal:
clear
clc
t=linspace(0,2*pi,1000);
suma=0;
for n=1:10000
suma=suma+((2./n).*(-1).^(n+1)).*sin(n.*t);
end
plot(t,suma)
grid
Any idea?

Answers (0)

Community Treasure Hunt

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

Start Hunting!