For an assignement in my Continuous Time Signals class, we were asked to calculate the fourier series of a given x(t). The problem I'm running into is we are asked to calculate the Dn in my m-file from -10 to 10 (course Matlab cannot handle negative indices and 0 since the numerical values of Dn are stored in an array). Is there any kind of solution that I could use to get aorund this to make it calculate from -10 to 0?
Thank you a lot.
Attached is my m-file with the necessary functions. The main m-file is called Prob2. Particularly the end where plotting of Dn is where I'm mainly talking about.
Using this still gives me problems since I've changed where my references of Dn are to DArry(n+offset). Maybe I'm just implementing this wrong?
??? Index exceeds matrix dimensions.
Error in ==> problem_2test at 70
Also since now I've implemented in right I believe, my matrixes are just 0....