you will provide both the code and snapshots of the generated output.

Assume that a signal x(t) has the following Fourier coefficients:
a_0=1
a_1=a_(-1)=1/4
a_2=a_(-2)=1/2
a_3=a_(-3)=1/3
These coefficients correspond to seven harmonic components of the signal x(t). Plot the harmonic components corresponding to k=0, k=1 and k=-1, k=2 and k=-2, k=3 and k=-3 , each on a separate graph. Finally, plot the signal x(t) as a sum of these harmonics.

Answers (2)

Well in order to run the code and get snapshots along the way. Use the publish functionality. This can be found from the Editor's Publish tab or by running publish.
doc publish
For more info.

2 Comments

It says snapshots in the question title...
The hints and code I gave should be sufficient. Anymore and I'd basically just be doing the whole thing for you. And I bet you're supposed to at least put in some effort yourself. Or is it allowable for your homework to just ask someone else to develop the complete solution for you and you turn in their work? I really can't add anymore without taking away any possibility that you'd be able to contribute anything.

Sign in to comment.

So start writing. You'll probably find these functions helpful: subplot(), plot(), sin(), cos(). Like
xFor1Term = sin(...... whatever
subplot(4,1,1);
plot(xFor1Term , 'r*-', 'LineWidth', 3);
grid on;
xFor2Term = sin(...... whatever
subplot(4,1,2);
plot(xFor2Term , 'r*-', 'LineWidth', 3);
grid on;
and so on.

2 Comments

4 rows of plots, 1 column of plots. The third number is the plot number going from upper left to lower right. So if you had
subplot(5,4,10);
you would have 5 rows and 4 columns, or 20 possible plot locations. Then 10 means the 10th one, which is the third row, second one in from the left.
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 27 Dec 2013

Commented:

on 27 Dec 2013

Community Treasure Hunt

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

Start Hunting!