Computing values of a formula
Mostrar comentarios más antiguos
Hi,

I tried to solve this equation but apperantly my output is wrong, can you tell me what am I missing ?
clc
clear
close all
n=input('Please enter n : ')
x=input('Please enter x : ')
for k=0:floor(n/2);
H=((-1)^k)*factorial(n)*(x^(n-2*k))/(2^k*factorial(k)*factorial(n-2*k));
H=H+((-1)^k)*factorial(n)*(x^(n-2*k))/(2^k*factorial(k)*factorial(n-2*k));
end
H
Respuesta aceptada
Más respuestas (1)
Fatemeh Salar
el 2 de Jul. de 2022
0 votos
Categorías
Más información sobre MATLAB 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!