Plot an equation (sigma operator)
Mostrar comentarios más antiguos
Hi everyone,

I would like to plot this equation for x=[-2,2] and x=3, I wrote this code but it ain't working. Could you please tell me how can I make it work ? Thanks in advance.
clc
clear
close all
H=0
for x=-2:0.1:2;
n=3;
for k=0:floor(n/2);
H=H+((-1)^k)*factorial(n)*(x^(n-2*k))/(2^k*factorial(k)*factorial(n-2*k));
end
end
x=-2:0.1:2;
plot(x,H,'r')
Respuesta aceptada
Más respuestas (1)
Fatemeh Salar
el 2 de Jul. de 2022
0 votos
1 comentario
Star Strider
el 2 de Jul. de 2022
As always, my pleasure!
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
