How do i define a variable as a function?
Mostrar comentarios más antiguos
Let us say there is a fucntion theta that is depedent on time: Theta(t); It is in a cos function so: cos(theta(t))
How do i differentiate this in matlab so it uses the chain rule?
clear all
syms t theta
theta=t;
f=cos(theta(t));
diff(f,t)
I have tried the above and got the errors:
Error using sym/subsref (line 49)
Error using maplemex
Error, (in MTM:-subsref) indices must be positive integers, got t
Error in test (line 5)
f=cos(theta(t));
Respuesta aceptada
Más respuestas (1)
KSSV
el 11 de Oct. de 2021
syms theta(t)
f=cos(theta(t));
diff(f,t)
1 comentario
Hamza Yusuf
el 11 de Oct. de 2021
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
