Scale function

Scaling data fields


Description

The Scale function converts the values ​​of a data field to a new scale. The first parameter specified is the data field to be scaled. With two optional parameters, the new minimum and maximum can be specified.


Without specification of minimum and maximum

If no min and max arguments are specified, the new range is set to -1 to +1. The largest positive or negative value forms the maximum value -1 or +1. The other values ​​are calculated accordingly. The zero position is retained.


With indication of minimum and maximum

If the optional parameters min and max are specified, the smallest value is calculated to min and the largest to max when scaling. The zero line is usually shifted.


Syntax

Scale (v)

Scale (v, min, max)

Examples

Scale ([4,-2,0,1]) = 1 -0.5 0 0.25

Scale ([4,-2,0,1],-1,1) = 1 -1 0.3333 0

Scale ([4,-2,0,1],2,4) = 4 2 2.6667 3


Data field based functions

ClrRect Deletes a rectangular area
Clip Limits values of a data field
Count Returns number of elements
Diff Difference values of elements
Dim Number of dimensions of tables
Flat Joins rows of a table
GetAt Value of a specified position
GetRect Returns the specified area
Insert Inserts new elements
Join Join fields together
New Generates a new list
Pick Get selected items from a list
Remove Removes items from a list
Reverse Inverts the order in a list
Scale Converts values to a new scale
SetAt Sets a value at a position
Split Splits a list into sublists
Sum Returns the sum of all elements
Text Generates a text list
Trim Removes invalid values