ProductName  

Creates a normalized matrix out of the current matrix.

Syntax

MatrixObject.Normalize(NormValue)

Return Value

Returns a matrix object reference to the normalized matrix.

Parameters

NormValue
Optional. Variable of type Double that, on exit, will return the norm value that was used to normalize the matrix (matrix element with maximum absolute value).

Remarks

The Normalize Method does not affect the current matrix, but instead returns a new matrix object, unlike the NormalizeMe method that normalizes current matrix.

Example

This example demonstrates the use of Normalize method.
Private Sub MatrixNormalize()

Dim A As Matrix, Norm As Double
    Set A = New Matrix
    A.Size 5, 5
    A.FillRandom
    Debug.Print "A ="
    Debug.Print A.GetString(0)

    Debug.Print "Normalized"
    Debug.Print A.Normalize(Norm).GetString(2)
    Debug.Print "Norm used = "; Norm
    
End Sub

Output

A =
|  6  2  8  6  5 |
|  4  9  8  7  2 |
|  9  7  5  3  0 |
|  1  4  1  2 10 |
|  4  1  0  0  4 |

Normalized
| 0.60 0.20 0.80 0.60 0.50 |
| 0.40 0.90 0.80 0.70 0.20 |
| 0.90 0.70 0.50 0.30 0.00 |
| 0.10 0.40 0.10 0.20 1.00 |
| 0.40 0.10 0.00 0.00 0.40 |

Norm used =  10 

See Also

NormalizeMe Method

Applies To: Matrix | CMatrix