Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Writing a (Matlab) function to find fourier coefficients. t is the time interval, 0:0.001:6*pi, x is the waveform function (cos(t) for example), N is the
Writing a (Matlab) function to find fourier coefficients. t is the time interval, 0:0.001:6*pi, x is the waveform function (cos(t) for example), N is the # of terms desired in the forier series, and T is the waveforms fundamentaI period.
Need help fixing THIS code to make it work for the given parameters and outputs, using the two "for loops. Thanks
1 function average a k,b k] fourier (t, x, T, Y) dt 0.01; for k 1 Y for q 1 :T a (k) a (k)+(2/T)* (x (q)) cos (k pitt (q))*dt; b (k) b (k) (2/T)* (x(q)) sin (k pit t (q) )*dt; average mean (x) 10 end 12 13 14 end 16 average double (mean (x)); a k-double (a (k)); 18 b k double (b (k)); 21 end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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 Started