Lydos.Matlab

Matrix.FromArray Method (Double[], Int32, Boolean)

Creates a matrix from an array.

[Visual Basic]
Shared  OverloadsPublic Function FromArray( _ 
   ByVal matrix As Double(), _ 
   ByVal cols As Integer, _ 
   ByVal rowMajor As Boolean _ 
) As Matrix
[C#]
public static Matrix FromArray(
   double[] matrix,
   int cols,
   bool rowMajor
);
[C++]
public: static Matrix* FromArray(
   double matrix __gc[],
   int cols,
   bool rowMajor
);
[JScript]
public static function FromArray(
   double[] matrix,
   int cols,
   bool rowMajor
): Matrix;

Parameters

matrix
Matrix in row major or column major order.
cols
The number of columns.
rowMajor
True if matrix is in row major order, false for column major.

Return Value

A matrix corresponding to the specified array.

Exceptions

Exception TypeCondition
ArgumentNullExceptionThrown when matrix is null.
ArgumentOutOfRangeExceptionThrown when cols is less than one or matrix does not have a usable number of elements.

See Also

Matrix Class | Lydos.Matlab Namespace | Matrix.FromArray Overload List