Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
derivation

Subject: derivation

From: nouha

Date: 22 Nov, 2010 15:48:03

Message: 1 of 3

data:
N=[26, 40.4, 49.6, 56.4, 62.1, 67.4, 72.4, 77.3, 82.2, 87.2, 92.5, 98.1, 104, 110.8, 118.5, 125.5, 138.5, 153, 178.8, 210.6];

M=0.000001*N

y=[-2.0100, -1.3830, -0.9550, -0.7470, -0.6290, -0.5670, -0.5330, -0.5120, -0.5000, -0.4920, -0.4880, -0.4850, -0.4830, -0.4820, -0.4810, -0.4810, -0.4800, -0.4800, -0.4800, -0.4800];

x=0.001*y

probleme:
H=-(dx/dM) "derivate a vector by anather vector"????

I must have as result:

H=[-41.213, -48.198, -38.707, -24.664, -15.904, -8.530, -3.303, -1.905, -1.063, -0.588, -0.455, -0.222, -0.133, -0.069, -0.001, 0.000, 0.000, 0.000, 0.000, 0.000]

I tried with diff and gradient but I did find the same result.

Subject: derivation

From: Sean de

Date: 22 Nov, 2010 17:25:06

Message: 2 of 3

"nouha " <nouha@voila.fr> wrote in message <ice3bj$jjk$1@fred.mathworks.com>...
> data:
> N=[26, 40.4, 49.6, 56.4, 62.1, 67.4, 72.4, 77.3, 82.2, 87.2, 92.5, 98.1, 104, 110.8, 118.5, 125.5, 138.5, 153, 178.8, 210.6];
>
> M=0.000001*N
>
> y=[-2.0100, -1.3830, -0.9550, -0.7470, -0.6290, -0.5670, -0.5330, -0.5120, -0.5000, -0.4920, -0.4880, -0.4850, -0.4830, -0.4820, -0.4810, -0.4810, -0.4800, -0.4800, -0.4800, -0.4800];
>
> x=0.001*y
>
> probleme:
> H=-(dx/dM) "derivate a vector by anather vector"????
>
> I must have as result:
>
> H=[-41.213, -48.198, -38.707, -24.664, -15.904, -8.530, -3.303, -1.905, -1.063, -0.588, -0.455, -0.222, -0.133, -0.069, -0.001, 0.000, 0.000, 0.000, 0.000, 0.000]
>
> I tried with diff and gradient but I did find the same result.

Well, how do you expect to derive that result? The first order forward difference result is this:
-diff(x)./diff(M)

Subject: derivation

From: Roger Stafford

Date: 22 Nov, 2010 18:33:04

Message: 3 of 3

"nouha " <nouha@voila.fr> wrote in message <ice3bj$jjk$1@fred.mathworks.com>...
> data:
> N=[26, 40.4, 49.6, 56.4, 62.1, 67.4, 72.4, 77.3, 82.2, 87.2, 92.5, 98.1, 104, 110.8, 118.5, 125.5, 138.5, 153, 178.8, 210.6];
>
> M=0.000001*N
>
> y=[-2.0100, -1.3830, -0.9550, -0.7470, -0.6290, -0.5670, -0.5330, -0.5120, -0.5000, -0.4920, -0.4880, -0.4850, -0.4830, -0.4820, -0.4810, -0.4810, -0.4800, -0.4800, -0.4800, -0.4800];
>
> x=0.001*y
>
> probleme:
> H=-(dx/dM) "derivate a vector by anather vector"????
>
> I must have as result:
>
> H=[-41.213, -48.198, -38.707, -24.664, -15.904, -8.530, -3.303, -1.905, -1.063, -0.588, -0.455, -0.222, -0.133, -0.069, -0.001, 0.000, 0.000, 0.000, 0.000, 0.000]
>
> I tried with diff and gradient but I did find the same result.
- - - - - - - -
  You can also use this:

 gradient(-x,M)

  Warning: Finding derivatives from discrete data like this can only be an approximation and it is very dependent on the accuracy of that data. Your data appears to be accurate only to about three decimal places, so the results would be quite inaccurate.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us