Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

Write a note on Organisation manuals

Answered: 1 week ago

Question

Define Scientific Management

Answered: 1 week ago

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago