How can I solve the following derative problem in Matlab ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
Bjorn Gustavsson
am 4 Okt. 2020
When you assign:
t = -1;
t becomes a standard double scalar, and is no longer a symbolic variable. So that's where you go completely wrong. Before that, when you describe your variable/function y it becomes a function of x, after that you assign x to some polynomial in t. That second assignment does not have "time-traveling" powers, it does not retroactively affect the definition for y, think of an assignment as "from here on forward...". Try to change order of your definitions...
HTH
Weitere Antworten (1)
Vuqar Samedov
am 6 Okt. 2020
2 Kommentare
Bjorn Gustavsson
am 6 Okt. 2020
You are pretty much on the right track.
1, Define your symbolic variables.
2, Look at the problem at hand, not that y depends on x that in turn, depends on t.
3, try do the assignments to y and x in different order, and see what happens when you run diff(y,x) and diff(y,t).
4, if something get you closer to the solution, have a look at how you can proceed from there.
5, a useful function might be matlabFunction - have a look at the help and documentation for that one.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!