Symbolic matlab: how to set a variable as a function of time?
59 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Ezequiel Garcia
el 18 de Abr. de 2017
Editada: Ezequiel Garcia
el 18 de Abr. de 2017
You need to declare t as a "symbolic"
syms t;
Respuestas (4)
Walter Roberson
el 15 de Feb. de 2012
syms theta t
diff(sin(theta(t)),t)
2 comentarios
Walter Roberson
el 19 de Abr. de 2017
In newer versions of MATLAB, you can use
syms theta(t)
diff(sin(theta),t)
Sergei Sergienko
el 13 de Jun. de 2020
Is it possible to make vector function of t? Something like this
sym('q(t)', [3 1])
diff(sin(q),t)
Wayne King
el 15 de Feb. de 2012
Hi Sebastian, do you know the expression for theta(t)?
syms theta t;
theta(t) = t^2;
diff(cos(theta),t)
0 comentarios
Sebastian D'Amico
el 15 de Feb. de 2012
1 comentario
Wayne King
el 15 de Feb. de 2012
Do you really need that if you do not know the expression for theta(t), you know df(theta)/dt = df/dtheta*dtheta/dt
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!