Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to take differentiation from two set of vectors
Replies: 1   Last Post: Jun 24, 2013 5:46 PM

 Messages: [ Previous | Next ]
 Derek Goring Posts: 3,922 Registered: 12/7/04
Re: How to take differentiation from two set of vectors
Posted: Jun 24, 2013 5:46 PM

On Tuesday, June 25, 2013 8:35:13 AM UTC+12, Charlie wrote:
> I have two vectors x and y with 100 datas in each. I would like to take the differentiation dy/dx at each point of x. Please let me know how to do this. Is there any inbuilt function or should I write any code for this. Please let me know if you have code for this.
>
>
>
> Regards
>
> Charlie

First order finite difference is:
dydx=diff(y)./diff(x);
and if the x are equally spaced, this can be simplified:
dydx=diff(y)/(x(2)-x(1));

Date Subject Author
6/24/13 Charlie
6/24/13 Derek Goring