Sometimes when I have some data (X1,Y1) and I want subtract from Y1 its maximum value (Y=Y1-max(Y1)), max(Y) is not zero (indeed is very near zero). I have tried to normalize the maximum value to zero but both methods failed to get max(Y)=0 (see below):
1) Info>List Peak Values>Copy Maximum Y1 value
Edit>Operate on Y> Y1-"Maximum Y1 value"
2) Generate>Y=f(X,Y1,Y2)>Y=Y1-$YMAX(1)
How can I remove completely the residue to get max(Y)=0?
Thanks.
Subtraction of maximum value of Y in 2D data
Moderator: DPlotAdmin
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Edit>Operate on Y with Y=Y-$YMAX should do it every time but may not make the new maximum exactly equal to 0. The trouble is $YMAX in the equation is replaced by a text representation of the number (just as if you copy/pasted the value). If Ymax cannot be represented exactly by ASCII text then you won't get 0 for the new maximum. If you repeat the operation one or more times you'll get closer to 0 but may not get there with this operation until Ymax is smaller than a value that can be represented by a double-precision number (which isn't a practical solution).
If you can accept your input being truncated once sufficiently close to 0, use Operate on Y with Y=if(abs(Y)<(some arbitrarily small number),0,Y).
If you can accept your input being truncated once sufficiently close to 0, use Operate on Y with Y=if(abs(Y)<(some arbitrarily small number),0,Y).
Visualize Your Data
support@dplot.com
support@dplot.com