Regularized hypergeometric function 1F2 within matlab?

12 ビュー (過去 30 日間)
Wojciech Kalinowski
Wojciech Kalinowski 2020 年 7 月 25 日
編集済み: David Goodmanson 2020 年 7 月 26 日
Hi, I'm trying to find the special function to use within my code:
function [result] = sin_derivatve(x,n)
if (rem(n,1) == 0) && (n ~= 0)
result = sin(x+n*pi()/2);
else
part1 = 2.^(n-1).*sqrt(pi()).*x.^(1-n);
part2 = hypergeom(1,[(1-n./2),(3/2-n./2)],-x.^2./4);
part3 = gamma([(1-n/2),(3/2 - n/2)]);
result = part1.*(part2./part3);
end
end
However, the hypergeom function above (part2) is 2F1 which is regulized by the gamma function (part3). Which means the matrix dimentions do not aline.
Is there a method to create a 1F2 Regularized hypergeometric function within matlab? Or another way to calculate the fractional derivative of sin(x)?
Thanks in advanced.

採用された回答

David Goodmanson
David Goodmanson 2020 年 7 月 26 日
編集済み: David Goodmanson 2020 年 7 月 26 日
Hi Wozciech,
if you add a prod function,
part3 = prod(gamma([(1-n/2),(3/2 - n/2)]))
then you're good to go. Or, you could use the gamma duplication formula to replace your current part1/part3
part1/part3 = x.^(1-n) * 2.^(n-1).*sqrt(pi) / (gamma(1-n/2)*gamma(3/2 - n/2))
with
part1/part3 = x.^(1-n) / gamma(2-n)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by