Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,919
Registered: 12/7/04
Re: How to take differentiation from two set of vectors
Posted: Jun 24, 2013 5:46 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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));



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.