Hi all,
I'm trying to calculate the derivative of a dataset that has varying and non-uniform x-value distances.
According to all examples I've found in the help and this forum the appropriate parameter to set the column for the x-values is "curve.x$ = wks_X;". Sadly, Origin ignores the x-values and assumes a uniform distance on the x-axis of 1.
Here's the command I'm using:
curve.x$ = wks_U;
curve.data$ = wks_I;
curve.result$ = wks_Deri;
curve.i1 = -1;
curve.smoothpts = 5;
curve.derivdeg = 1;
worksheet -t 2 4; //the 2nd column is I and originally type Y
curve.sgderiv();
worksheet -t 2 1; //converting it back to a Y-axis for plotting purposes
A problem that I have is that the derivative is only then calculated as long a the data-column is of the X-type (even though it should be of the Y-type!). That's why I declared it to be X-type initially, but of course this cannot be correct.
Can anyone point out the correct way of using a X-value column and a Y-value column together with curve.sgderiv() please?
Thanks for your time,
Johannes
Origin Ver. and SR (Select Help-->About Origin): 8 SR4
Operating System: WinXP