How can I use symbolic variables while solving problems of MATLAB Cody?

1 回表示 (過去 30 日間)
Swati Sarangi
Swati Sarangi 2021 年 1 月 23 日
編集済み: John D'Errico 2021 年 1 月 23 日
syms x
x0 = 0.2;
f = cosh(x)/ (cosh(x0)-cosh(x))^0.5
I = int(f,0,x0);
I
Can someone verify this code snippet?
This code performs integration.

回答 (1 件)

John D'Errico
John D'Errico 2021 年 1 月 23 日
編集済み: John D'Errico 2021 年 1 月 23 日
I recall that Cody disallows the use of essentially all toolboxes. Symbolic variables are only active for you, IF you have the symbolic toolbox.
Why are they disallowed? Because that would not be fair to others. Not everyone has every toolbox. In fact many people might not have any specific toolbox. So Cody, to be fair to all users, only should allow solutions that use base MATLAB because otherwise you might find a solution that uses some function that nobody else will have. And that could not possibly be fair to others to compare to code they cannot access.
I can probably find a statement to this effect, were I to go looking for one in the help, but then I just found this Answer:
What Steven says, I would absolutely trust to be fact. Given that - Steve, should I buy or sell XXX stock? ;-)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by