calculating the diffference from data ?

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
bfennema
Posts: 7
Joined: Sun Oct 23, 2011 4:31 am
Location: Bray, Ireland

calculating the diffference from data ?

Post by bfennema »

Dear forum,

my name is Boris and I am new to DPlot but very impressed with the ease of use.

There is one task that I would like to do in Dplot and perhaps it is possible,

I have data such like
(x,y)
(1,10)
(2,20)
(3,20)
(4,25)
(5,32)

and would like to produce a sequence where each point in Y is the difference between Y(n)-Y(n-1) - this would make the first point invalid.

(.,.)
(2,10) -- 20-10
(3,0) -- 20-20
(4,5) -- 25 -20
(5,7) -- 32 - 25

Can this be done ?

The file is large so I cannot do it in Excel.

best regards,

B.
bfennema
Posts: 7
Joined: Sun Oct 23, 2011 4:31 am
Location: Bray, Ireland

Post by bfennema »

p.s.

Just figured, since x increments by 1, I can differentiate the curve

I will try that once I have the data set here.

B.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

The Differentiate command in the current version will not do what you want (or at least not what you described). (The next release will, because it includes a "Previous point" method that uses Y(n) and Y(n-1), as opposed to the "Central difference" method, which uses Y(n+1) and Y(n-1)).

You can do this: Use Edit>Copy>Data values and Edit>Paste to add a copy of your original data. Use Edit>Operate on X with X=X+1 on the copy. This shifts all points in the copy to the right by 1. Then use Generate>Y=f(X,Y1,Y2,...) with Y=Y2-Y1.
Visualize Your Data
support@dplot.com
bfennema
Posts: 7
Joined: Sun Oct 23, 2011 4:31 am
Location: Bray, Ireland

Post by bfennema »

Many thanks,

That should do what I need - excellent. I had not thought of that combination of moves, that is very flexible.

Thank you !

B.
Best regards,

Boris Fennema
Post Reply