ILNumerics Ultimate VS

MatFileArrays Property

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Retrieve a cell with all arrays stored in the mat file

[ILNumerics Core Module]

Namespace:  ILNumerics
Assembly:  ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public RetCell Arrays { get; }

Property Value

Type: RetCell
Remarks

The cell returned will be clone of the arrays stored in the mat file. Altering any cell elements will leave the arrays in the matfile (class/memory object) untouched.

The cell returned will be of size [n,2], where n is the number of arrays contained. The first row saved the arrays, the second row containes scalar string arrays with the name of the array in the corresponding row.

[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