symsum does not work with symprod
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Adam Golinski
el 1 de Mzo. de 2023
Comentada: Adam Golinski
el 3 de Mzo. de 2023
I'm trying to avaluate the following:
syms j k
double(symsum((-symprod((j+0.3-1)/(j), j, 1,k))^2, k, 2, Inf))
It returns: -0.0806, which is nonsensical, since this is a sum of squared numbers.
When I evaluate the same in Wolfram Alpha using "sum( (product (j+0.3-1)/j, j=1..k)^2, k, 2, infinity)", I get 0.226456, which seems to be correct, since Matlab seems to converge to this number up to k=100000 (and then it crushes). How can I make it work? Thanks.
0 comentarios
Respuesta aceptada
Walter Roberson
el 1 de Mzo. de 2023
syms j k
double(symsum((-symprod((j+0.3-1)/(j), j, 1,k))^2, k, 2, Inf))
So it works in current releases.
I am checking back to see if I can figure out when it was fixed.
3 comentarios
Walter Roberson
el 1 de Mzo. de 2023
Works in R2018b.
It appears that R2018a is the last release that has this problem.
It is a problem with the symsum() part, by the way; it is returning a hypergeom() minus a constant when it should be returning an expression in gamma() minus that same constant.
Más respuestas (0)
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!