MATLAB: How can i perform a Fourier series on this function

fourier_seriesmat lab

clear all;
close all;
clc;
syms n t1 t2 T f0 t;%t2=T;
func=(f0/t2-t1)*(t-t1);
n=1:10;
syms t t1 T;%T=t2;
w = (2*pi)/T;
a0 = (2/T)*int(func,t,0,T);
an = (2/T)*int(func*cos(n*w*t),t,0, T);
bn = (2/T)*int(func*sin(n*w*t),t, 0,T);
f = a0/2 + dot(an,cos(n*w*t)) + dot (bn, sin(n*w*t));
ezplot(func);
hold on;
grid on;
plot(f);

Best Answer

Here is the full solution to your problem. Good luck.
Related Question