Symbolic matlab: how to set a variable as a function of time?
52 ビュー (過去 30 日間)
古いコメントを表示
Hello to all! I'm trying to set a symbolic variable as a function of "t". This is because I need to obtain something like this:
K>> diff(sin(theta),t)
ans = diff(theta,t)*cos(theta)
or
ans= theta_dot*cos(theta)
but how to tell Matlab that variable theta is a function of time "t"?
Thank you!
1 件のコメント
Ezequiel Garcia
2017 年 4 月 18 日
編集済み: Ezequiel Garcia
2017 年 4 月 18 日
You need to declare t as a "symbolic"
syms t;
回答 (4 件)
Walter Roberson
2012 年 2 月 15 日
syms theta t
diff(sin(theta(t)),t)
2 件のコメント
Walter Roberson
2017 年 4 月 19 日
In newer versions of MATLAB, you can use
syms theta(t)
diff(sin(theta),t)
Sergei Sergienko
2020 年 6 月 13 日
Is it possible to make vector function of t? Something like this
sym('q(t)', [3 1])
diff(sin(q),t)
Wayne King
2012 年 2 月 15 日
Hi Sebastian, do you know the expression for theta(t)?
syms theta t;
theta(t) = t^2;
diff(cos(theta),t)
0 件のコメント
Sebastian D'Amico
2012 年 2 月 15 日
1 件のコメント
Wayne King
2012 年 2 月 15 日
Do you really need that if you do not know the expression for theta(t), you know df(theta)/dt = df/dtheta*dtheta/dt
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!