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.

Syntax

new_table = norm( table )

bullet.gif    table is a 1-dimensional array or CImage object.

bullet.gif    new_table is the returned table.

Examples

The following script creates a Gaussian normal population of 10,000 numbers with the area under the curve normalized to 1.0.

t = norm( gaussdev(10000) )

-- create a table of 10,000 values and normalize it

  

The next script normalizes a CImage.

V = AttachView( "CImageView" )

-- attach the topmost image window

Assert( V and V:Count() > 0 )

-- make sure an image window is on top

norm( V:GetImage() )

-- normalize the CImage

Related Topics

Table and Array Functions, normn


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.