-
-
Save caiorss/160d8090d946d22a9878d93ed81846ae to your computer and use it in GitHub Desktop.
MATLAB fourier series test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syms n t; | |
% Set d to the series, using symsum() | |
d=1+symsum(sin(n/2*t)*(sin(((n+2)*pi)/(2))*4/(pi^2*n^2)+(-1)^n*2/(n*pi)),n,1,100); | |
% Prep an x-axis | |
t=linspace(-10,10,1000); | |
% Evaluate the values accordingly | |
data=eval(d); | |
% And plot it | |
plot(t,data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment