MeijerG function using MATLAB's symbolic toolbox

조회 수: 10 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2016년 7월 15일
편집: MathWorks Support Team 2025년 1월 19일
I want to know whether there is anyway I can use MeijerG functions in Matlab scripts using symbolic toolbox. Specifically, MeijerG functions describe the probability densities and it is easier to work with them. Currently, I use Maple to get the results and then retype them in Matlab. But, I am unable to use them in symbolic toolbox

채택된 답변

MathWorks Support Team
MathWorks Support Team 2025년 1월 19일
편집: MathWorks Support Team 2025년 1월 19일
As of R2017b, the function "meijerG" calculates the Meijer G-Function. This function can return either numerical values or symbolic expressions for the Meijer G-Function depending upon the input.
For 'double' inputs, "meijerG" returns a double, as shown below: 
     >> meijerG(3, [], [], [], 3)
     ans =
         6.4488
For 'sym' inputs, "meijerG" will return an exact symbolic answer whenever possible. An example is shown below:
     >> meijerG(sym(2/5), [], sym(1/2), [], sym(3))
 
     ans =
 
     (2^(4/5)*3^(1/2)*gamma(1/10))/80
The documentation linked below has more details about "meijerG"'s full functionality:
For prior releases, the symbolic MeijerG function is only available in MuPAD. From MATLAB, it must be evaluated using "evalin", as shown below:
     >> y=evalin(symengine, 'simplify(meijerG([[3],[]], [[],[]],3))'); 
     y =
 
     9*exp(-1/3)
Once this command executes, 'y' will contain symbolic MeijerG function for given arguments.
Note that without the call to "simplify", an expression in terms of the MuPAD function "meijerG" may be returned, which will not be understood by MATLAB in further function calls. You can pass this back to "evalin" by first converting it with the "char" function, but this workflow is not recommended.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Utilities for the Solver에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by