How to write diff (exp(x.*log(x))) on MATLAB command window?

I am trying to compute the derivative using the command diff:
syms x
diff (exp(x.*log(x)))
Error using sym/subsindex (line 853)
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic
variables, and function body must be sym expression.
Error in sym/subsref (line 898)
R_tilde = builtin('subsref',L_tilde,Idx);

4 件のコメント

Wan Ji
Wan Ji 2021 年 8 月 25 日
The syntax can work for my matlab version
>> syms x
diff (exp(x.*log(x)))
ans =
exp(x*log(x))*(log(x) + 1)
Walter Roberson
Walter Roberson 2021 年 8 月 25 日
I suspect that you have accidentally created a variable named one of diff or exp or log . Of those, it is most common for people to accidentally create diff
N/A
N/A 2021 年 8 月 25 日
Thank you. I wil check again.
N/A
N/A 2021 年 8 月 25 日
I guess so. It worked once I cleared my workspace. Thank you

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

質問済み:

2021 年 8 月 25 日

編集済み:

2021 年 8 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by