norm (replaces TNorm)
The norm function normalizes a 1-dimensional array or CImage object by scaling all its elements to make their sum equal to 1.0.
Whereas this function operates on a pure (indexed) array, the slightly slower normn function operates on a general table that may be a multi-dimensional array or contain a mixture of numbers, strings, named keys, and sub-tables.
new_table = norm( table )
    table is a 1-dimensional array or
CImage object.
    new_table is the returned table.
The following script creates a Gaussian normal population of 10,000 numbers with the area under the curve normalized to 1.0.
| 
 | 
 -- create a table of 10,000 values and normalize it  | 
The next script normalizes a CImage.
| 
 | 
 -- attach the topmost image window  | 
| 
 | 
 -- make sure an image window is on top  | 
| 
 | 
 -- normalize the CImage  | 
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.