Hej, me and my study group have an issue regarding substituting time derivative of a variable with some more convinient expression.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jesper Ankersen
am 1 Okt. 2020
Kommentiert: Ameer Hamza
am 1 Okt. 2020
eqn = ............... + diff(x(t), t) + a*b*c...................;
So in the above equation there is a variabel named diff(x(t), t), this variable was introduced earlier in the script.
Now we want to substitute it with another more convinient name such as:
syms x_dot;
subs(eqn, 'diff(x(t), t)', x_dot);
But this gives a long list of errors, does anybody know why this is so difficult?
It is no problem to achieve when we substitute another variable from eqn such as:
syms x_dot;
subs(eqn, a, x_dot);
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 1 Okt. 2020
Don't input the symbolic expression as string. Following works
syms y(x) dy
eq1 = diff(y)^2
subs(eq1, diff(y, x), dy)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!