I want to Differentate 2 equations inside a function but for some reason it breaks when i try to use diff.
this is the longer form of writing out what i want to do
v1sq = (xdot1^2 + ydot1^2)
But given i have quite a few of velocitys to calculate i wanted to use a function to do rather than creating loads of xdot variables and writing it all out by hand.
first i tried to do it with this function
function vSq=FindVelocity(x_pos,y_pos)
vSq=x_posdot^2 + y_posdot^2
However that didnt work so after some research i tried this
function vSq=FindVelocity(x_pos,y_pos)
vSq=x_posdot^2 + y_posdot^2
However i still got an error saying "Unrecognized function or variable 't' "
Is what im tyring to do possible in matlab or will i just have to type it all out by hand