CAD/differentiation
Expert: George Moustris - 6/24/2009
Questionsir
i have 2 arrays,one of torque and the other of time and
i got its plot.Now,how could i find out the differential of
these arrays?(i have no supporting diff equation or
variables).this is discrete differentiation.
i intend to find where in the plot of the differential the
slope becomes zero.
also,is there a way to find out the equation of a function
when i hav just its plot?
thank you
rohan
AnswerHi Rohan
when you say "arrays" do you mean vectors? If so, by "differential" i assume you mean the derivative of the torque. Since you have discrete points, this is formally called the "finite difference". If the torque vector is Tq (1xn) and the time vector is t (1xn), the forward finite difference is:
diff(Tq)./diff(t)
See the matlab "diff" function for more.
For your second question, do you mean that you have a MATLAB plot and want to get the data points? Or you have a set o data points and want to find tha actual continuous function that produces them? In the first case you can get them using the get/set functions or the figure's plot tool (see the toolbars of the figure). In the second case, what you want is called "data fitting". There is no unique function that fits a data set thus you must restrict your search. Matalab has built-in functions for this but i suggest you first read the theory of data fitting before attempting to perform it.
Best
G.