How do i write the MATLAB code for the expression given below?
조회 수: 6 (최근 30일)
이전 댓글 표시
답변 (1개)
Shivani Dixit
2022년 11월 2일
편집: Shivani Dixit
2022년 11월 2일
Hi Hemvarshan,
I understand that you want to convert the above expression into MATLAB Code.
From the code it seems that you are using advanced mathematical functions like gamma functions. You can always leverage MATLAB Documentaion to search for syntax, function code and relevant examples for such functions.
Consider an example below:
To evaluate the expression Γ(0.5), you can use the following MATLAB code:
y = gamma(0.5)
Similarly, you can convert the complete expression into code. You can also use functions to avoid code repetition.
댓글 수: 1
Walter Roberson
2022년 11월 2일
Note: there are two different gamma() functions that are important for this purpose
which gamma(0.5)
which gamma(sym(0.5))
So if you pass in a double precision number, the double-precision gamma() function will be used. That is a completely different code path than if gamma is invoked on a symbolic expression of any kind
gamma(0.5)
gamma(sym(0.5))
When you are working with MeijerG functions and so on, you will certainly want to be working with the symbolic version
참고 항목
카테고리
Help Center 및 File Exchange에서 Gamma Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!