Hi to all,
I have tried to derivative a simple sine function with diff.
Here are the code:
x = 0:pi/100:10*pi;
y = sin(x);
y1 = diff(y);
The question is this: why the derivative (a cosine function) isn't with max and min of 1 and -1 like sin(x)?
If I do:
Scale = Y/Y1
I obtain Scale = 31.8362.
The same is for second derivative: to obtain function in scale I must apply Scale factor two times.
Who can explain me the correct way to obtain a discrete derivative via Matlab?