Coding for summation of Fourier transform

2 vues (au cours des 30 derniers jours)
Tu Nguyen
Tu Nguyen le 3 Mar 2022
clc
clear all
close all
L = 1;
n = [-4:4];
syms x
rectn = rectangularPulse(-1,1,x);
F_rectn = fourier(rectn);
rp1 = real(F_rectn)*cos(2*pi*n*x/L);
F_0 = F_rectn(x==0);
y1 = zeros(1, numel(n));
for i = numel(n);
y1 = y1 + real(F_rectn).*cos(2*pi*n(i)*x/L);
end
y1 = y1 + F_0;
fplot(y1)
Hi all, I checked my code many times, but it returns the error of summation. Can anyone help me fix the code like the formula in the picture but eliminate the imaginary part?

Réponses (0)

Catégories

En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by