Why is there this error in the code? Using MATLAB gn=3 sn=17 I =(gn*60)+(sn*2) A = 250/(I
Fantastic news! We've Found the answer you've been seeking!
Question:
Why is there this error in the code?
Using MATLAB
gn=3
sn=17
I =(gn*60)+(sn*2)
A = 250/(I + 100)
T = 1/(5*I)
a0 =(A/2)
number_of_points = 100
step_size = T/number_of_points
t = 0:step_size:T
f = a0
N=100
n=1:N
an = 0
bn = (A)/(n*pi)*(1 - cos(n*pi))
f = f + an*cos( n*pi*t/(T/2) ) + bn*sin( n*pi*t/(T/2) )
figure(1)
plot(t,f)
hold on
square_wave_f=A/2 + A/2*square(2*pi*t/T)
line_style ='r-'
plot(t,square_wave_f,line_style)
hold off
Related Book For
Digital Systems Design Using Verilog
ISBN: 978-1285051079
1st edition
Authors: Charles Roth, Lizy K. John, Byeong Kil Lee
Posted Date: