How can I plot the graph for this function?

2 visualizaciones (últimos 30 días)
Gufran Malik
Gufran Malik el 7 de Jun. de 2022
Editada: Torsten el 21 de Ag. de 2022
f(x)=symsum(2^(-m*x)*(gamma(m*x+j-1+1)/gamma(m*x-1+1))*h(j/m),j.0.Inf)
where h(j/m)=(j/m)^2+1, m=100.
Please help me out.
  5 comentarios
Gufran Malik
Gufran Malik el 10 de Jun. de 2022
Thanks @Dyuman Joshi but this is giving error.
Dyuman Joshi
Dyuman Joshi el 11 de Jun. de 2022
It worked on my pc without any errors, but it took an eternity to run :')
(i3-5th gen, 8 gb ddr3 ram)

Iniciar sesión para comentar.

Respuesta aceptada

Torsten
Torsten el 12 de Jun. de 2022
Editada: Torsten el 12 de Jun. de 2022
m = 100;
h = @(x) x.^2+1;
x = 0:0.01:10.0;
tol = 1e-16;
for i = 1:numel(x)
Lm(i) = fun_Lm(m,h,x(i),tol);
end
plot(x,Lm)
function value = fun_Lm(m,h,x,tol)
value = 0.0;
error = Inf;
j = 0;
summand = 1.0;
while error > tol
value = value + summand;
error = abs(summand);
summand = summand * (m*x+j) * 1/2 * 1/(j+1) * h((j+1)/m)/h(j/m);
j = j + 1;
end
value = value/2^(m*x) ;
end
  1 comentario
Gufran Malik
Gufran Malik el 17 de Ag. de 2022
@Torsten Thank you so much. It worked for me and helped me a lot.

Iniciar sesión para comentar.

Más respuestas (1)

Gufran Malik
Gufran Malik el 17 de Ag. de 2022
How can we plot this function? @Torsten Please help me with this
  4 comentarios
Gufran Malik
Gufran Malik el 21 de Ag. de 2022
@Torsten Thank you so much.
Gufran Malik
Gufran Malik el 21 de Ag. de 2022
@Walter Roberson Thank you so much.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by