2.2.36 vshift

Brief Information

Shift a vector

Command Line Usage

1. vshift ix:=col(1) delta:=3 fill:=0 ox:=col(1); 2. vshift ix:=col(1) delta:=3 fill:=0 ox:=<new>;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input ix

Input

vector

<active>

Specifies the input data to be shifted.

Shifted Position (First Row) delta

Input

int

1

Specifies the new position for the first row.

Padding fill

Input

double

0

Specifies a padding value. Cells in the output vector whose indices are less than the delta variable will be filled with this value.

Output ox

Output

vector

<new>

Specifies the output for the shifted vector.

Description

The vshift function shifts the input vector and pads the first few cells in the new vector with a specified value.

Examples

  • Sample Code
// The vshift function can be used in situations where two datasets
// share an X column, but you wish to move one dataset relative to;
// another in the X direction. This amounts to moving the data in the;
// worksheet down (vertically, thus 'v'shift)
// New book and import data
newbook;
path$ = system.path.program$ + "Samples\Curve Fitting\Enzyme.dat";
impasc fname:=path$;
// Plotting columns 2 vs 1 and 3 vs 1
range r1 = (1,2);
range r2 = (1,3);
win -t plot line;
plotxy r1 plot:=200 color:=color(orange) ogl:=1;
plotxy r2 plot:=200 color:=color(olive) ogl:=1;
win -z;   //Maximize window
// Pause so we can see the shift between our two curves
type -b We will use the vshift function to shift the first curve to match the second in the region above 10uM.;

// Now shift by 3 rows by padding with missing value and replacing the original data
range -w rWks = 1; // -w switch gets a worksheet range of plot object
vshift ix:=rWks delta:=3 fill:=0/0 ox:=<input>;