フィルターのクリア

How do i write the MATLAB code for the expression given below?

6 ビュー (過去 30 日間)
Hemvarshan
Hemvarshan 2022 年 10 月 30 日
コメント済み: Walter Roberson 2022 年 11 月 2 日

回答 (1 件)

Shivani Dixit
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
Walter Roberson 2022 年 11 月 2 日
Note: there are two different gamma() functions that are important for this purpose
which gamma(0.5)
built-in (/MATLAB/toolbox/matlab/specfun/@double/gamma) % double method
which gamma(sym(0.5))
/MATLAB/toolbox/symbolic/symbolic/@sym/gamma.m % sym method
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)
ans = 1.7725
gamma(sym(0.5))
ans = 
When you are working with MeijerG functions and so on, you will certainly want to be working with the symbolic version

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGamma Functions についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by