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
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
Step by Step Solution
3.41 Rating (138 Votes )
There are 3 Steps involved in it
Step: 1
The error in the code is in the calculation of bn where the formula se...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Digital Systems Design Using Verilog
Authors: Charles Roth, Lizy K. John, Byeong Kil Lee
1st edition
1285051076, 978-1285051079
Students also viewed these Databases questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App