ILNumerics Ultimate VSMatFileGetArrayT Method (Int32)ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Retrieve array by index

[ILNumerics Core Module]

Namespace: ILNumerics
Assembly: ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.3.0.0 (5.3.7131.2749)
Syntax

public RetArray<T> GetArray<T>(
	int index
)

Parameters

index
Type: SystemInt32
Index of the array

Type Parameters

T
Expected type of the array

Return Value

Type: RetArrayT
A clone of the array found or null, if no array at the given index exists
Remarks

[ILNumerics Core Module]

Examples

// MatFile should be used in an 'using' block, 
// cleaning up its resources automatically.
using (MatFile mat = new MatFile()) {
    mat.AddArray(counter<sbyte>(-10, 2, 4, 8, 13), "myArray");
    mat.Write("file.mat");
}

// reading back using ILMath.loadArray<T>(...)
Array<sbyte> A = loadArray<sbyte>("file.mat", "myArray");
Assert.IsTrue(A.Equals(counter<sbyte>(-10, 2, 4, 8, 13)));

// reading back using MatFile
using (var back = new MatFile("file.mat")) {
    Array<sbyte> B = back.GetArray<sbyte>("myArray");

    // ... or usign cell methods: 
    Array<sbyte> C = back.Arrays.GetArray<sbyte>(0);

    Assert.IsTrue(B.Equals(counter<sbyte>(-10, 2, 4, 8, 13)));
    Assert.IsTrue(C.Equals(counter<sbyte>(-10, 2, 4, 8, 13)));
}
See Also

Reference