How do I derive a parametric slope symbolically?
Show older comments
I want to have matlab derive a parametric slope symbolically.
In other words, given x and y depend on some parameter, let's say t, if I want the parametric slope, I should get dy/dx = (dy/dt)/(dx/dt). I tried the following below to get this to work:
syms t x(t) y(t)
x = x(t)
y = y(t)
ParametricSlope = diff(y,x)
output:
Error using sym/diff (line 70)
Second argument must be a variable or a nonnegative integer specifying the number of differentiations.
What do I need to change/add to get this to work?
Accepted Answer
More Answers (1)
syms x(t) y(t)
slope = diff(y,t)/diff(x,t) % simple diff(y) can also be used
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!