How to find the equation of a line for a 3d line plot

6 views (last 30 days)
Hello Matlab community!
I have three variables plotted on a 3-d graph (two position variables and one time variable). In order to calculate the instantaneous velocity--ie the derivative of the line at each point--I need to define the equation of this line.
Does anyone have an idea of how to go about doing this? Google forums haven't helped yet!

Answers (1)

Prajit T R
Prajit T R on 1 Mar 2018
It is possible to get the equation of the line using the fit function. Assuming that the two position variables are x and y, and the time variable being t, x=f(t) and y=g(t). You can use the fit function to get the equations for x in terms of t and y in terms of t. The instantaneous velocity can be obtained by using the derivatives of these equations. The Curve Fitting toolbox is well-equipped to help you in your quest. To access the curve fitting tool, type 'cftool' in the command line.
Cheers

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!