Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to Create an Anonymous Function?

1 回表示 (過去 30 日間)
William Tran
William Tran 2020 年 10 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
How do I enter ((-e^t) -1) / (1-e^t)) as an anonymous function?

回答 (1 件)

Stephan
Stephan 2020 年 10 月 18 日
編集済み: Stephan 2020 年 10 月 18 日
Try to write it in one line - i guess you use an older release of Matlab, that does not support the semicolon operator in a second line - also a closing bracket ist missing:
x_explicit = @(t,x) ((-exp(t)-1)./(1-exp(t)));
btw: your function does not use x - why is it input argument?
  2 件のコメント
William Tran
William Tran 2020 年 10 月 18 日
Yea, it was the closing bracket; thankyou
Stephan
Stephan 2020 年 10 月 18 日
Did you notice that you can accept and/or vote for useful answers?

Community Treasure Hunt

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

Start Hunting!

Translated by