Subs Command & Conversion into Matlab Function (multivariable)

1 回表示 (過去 30 日間)
Alex Santizo
Alex Santizo 2020 年 2 月 7 日
回答済み: Jyothis Gireesh 2020 年 2 月 10 日
syms t g f
g=t*sin*(1/2*t)+ln(t-1)
f=diff(g,t)
subs (f,t,4/3)
%Also need to solve by conversion into a matlab function
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 2 月 7 日
You need to pass a value to sin instead of multiply sin itself by something
t*sin(t/2)
For example.

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

回答 (1 件)

Jyothis Gireesh
Jyothis Gireesh 2020 年 2 月 10 日
Here are a few pointers which may be able to help you:
  • As explained by Mr. Walter Roberson above, you need to pass an input argument to the “sin()” function. Or else it will be flagged as an error at run-time.
  • I am assuming here that you want to convert the symbolic expression in “f” to a MATLAB function. You may use the “matlabFunction()”to achieve this result.
Please refer to the following documentation link on “matlabFunction()” for any clarifications
Hope this helps!!

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by