Why the results are different using 'hypergeom' function and 'pochhammer' function to calculate the Gauss hypergeometric function
Show older comments
First, I calculated the the Gauss hypergeometric function using hypergeometric function. For example,
>> hypergeom([-30,30.5],1,0.64)
ans =
0.0379
And
>> F(-30,30.5,1,0.64)
ans =
-86.1497
The 'F' function I wrote using pochhammer function is as follows.
function f = F(n,a,c,x)
k = 0:1:abs(n);
vector = pochhammer(n,k).*pochhammer(a,k).*(x.^k)./pochhammer(c,k)./factorial(k);
f = sum(vector);
end
However, they are same for some other parameters. For example,
>> F(-10,10.5,1,0.64)
ans =
0.1592
>> hypergeom([-10,10.5],1,0.64)
ans =
0.1592
Both the results are 0.1592. Why is that?
Above are the links of the two functions.
Accepted Answer
More Answers (0)
Categories
Find more on Thermal Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!