user7408924
user7408924

Reputation: 97

Matlab differentiable symbol

I want to define a differntiable sym in MatLab so that

sym x y t;
eq = y == x;    
diff(eq,'t') = dy/dt == dx/dt

With this Code dy/dt and dx/dt are calculated and 0 is returned. How can I tell matlab that y and x are functions of t?

I do not know the explicit functions, so substituting y and x with their explicit functions is not an option.

Upvotes: 0

Views: 61

Answers (1)

Rahul
Rahul

Reputation: 171

What you are looking for is this-

syms x(t) y(t)

Define your functions as-

x(t)='your function';
y(t)='your function';

And then calculate the differential as follows-

diff(x) %since x is only a function of t
diff(y) %since y is only a function of t

Upvotes: 1

Related Questions