Azzera filtri
Azzera filtri

Regularized hypergeometric function 1F2 within matlab?

4 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

David Goodmanson
David Goodmanson il 26 Lug 2020
Modificato: David Goodmanson il 26 Lug 2020
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)

Più risposte (0)

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by