Class MatlabWriter
Write data objects to a MAT file
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class MatlabWriter : IDisposable
Constructors
MatlabWriter(String)
Create a MatlabWriter to write to a given file name.
Declaration
public MatlabWriter(string fileName)
Parameters
Type |
Name |
Description |
String |
fileName |
The file name to write to (will be created if missing, or truncated if already exists)
|
Methods
Dispose()
Release the stream used by a MatlabWriter
Declaration
Generate a Matlab V5 compatible header byte array
Declaration
protected static byte[] Matlab5Header(string comments)
Parameters
Type |
Name |
Description |
String |
comments |
The comments that will go into the header of the Matlab file.
|
Returns
Type |
Description |
Byte[] |
The header as a byte array.
|
TryWriteDictionary(String, Object)
Declaration
protected bool TryWriteDictionary(string name, object value)
Parameters
Returns
Write(Matrix)
Declaration
protected void Write(Matrix matrix)
Parameters
Type |
Name |
Description |
Matrix |
matrix |
|
Write(MatType)
Declaration
protected void Write(MatType type)
Parameters
Write(Byte)
Declaration
protected void Write(byte value)
Parameters
Type |
Name |
Description |
Byte |
value |
|
Write(Byte[])
Write an array of bytes to the stream
Declaration
protected void Write(byte[] bytes)
Parameters
Type |
Name |
Description |
Byte[] |
bytes |
|
Write(Double)
Declaration
protected void Write(double value)
Parameters
Type |
Name |
Description |
Double |
value |
|
Write(Int16)
Declaration
protected void Write(short value)
Parameters
Type |
Name |
Description |
Int16 |
value |
|
Write(Int32)
Declaration
protected void Write(int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
Write(Int64)
Declaration
protected void Write(long value)
Parameters
Type |
Name |
Description |
Int64 |
value |
|
Write(Single)
Declaration
protected void Write(float value)
Parameters
Type |
Name |
Description |
Single |
value |
|
Write(String, Matrix, Matrix)
Write a named Matrix to the stream
Declaration
public void Write(string name, Matrix matrix, Matrix imaginary = null)
Parameters
Type |
Name |
Description |
String |
name |
Name of the matrix.
|
Matrix |
matrix |
A matrix.
|
Matrix |
imaginary |
If writing a complex matrix, the imaginary part of the matrix.
|
Write(String, MatlabReader.ComplexMatrix)
Write a named ComplexMatrix to the stream
Declaration
public void Write(string name, MatlabReader.ComplexMatrix matrix)
Parameters
Write(String, IReadOnlyList<Boolean>)
Write a named bool array to the stream
Declaration
public void Write(string name, IReadOnlyList<bool> array)
Parameters
Write(String, IReadOnlyList<Double>)
Write a named vector to the stream
Declaration
public void Write(string name, IReadOnlyList<double> array)
Parameters
Write(String, IReadOnlyList<Int32>)
Write a named int array to the stream
Declaration
public void Write(string name, IReadOnlyList<int> array)
Parameters
Write(String, IReadOnlyList<Int64>)
Write a named long array to the stream
Declaration
public void Write(string name, IReadOnlyList<long> array)
Parameters
Write(String, IReadOnlyList<UInt32>)
Write a named int array to the stream
Declaration
public void Write(string name, IReadOnlyList<uint> array)
Parameters
Write(String, IReadOnlyList<UInt64>)
Write a named ulong array to the stream
Declaration
public void Write(string name, IReadOnlyList<ulong> array)
Parameters
Write(String, Double)
Write a named scalar to the stream
Declaration
public void Write(string name, double value)
Parameters
Write(String, Int32)
Write a string value with zero padding to write numBytes in total.
Declaration
protected void Write(string value, int numBytes)
Parameters
Write(String, Object)
Write a named object to the stream
Declaration
public void Write(string name, object value)
Parameters
Write(String, Object[,])
Write a named cell array to the stream
Declaration
public void Write(string name, object[, ] array)
Parameters
Write(String, String)
Write a named string to the stream
Declaration
public void Write(string name, string value)
Parameters
Write(UInt16)
Declaration
protected void Write(ushort value)
Parameters
Type |
Name |
Description |
UInt16 |
value |
|
Write(UInt32)
Declaration
protected void Write(uint value)
Parameters
Type |
Name |
Description |
UInt32 |
value |
|
Write(UInt64)
Declaration
protected void Write(ulong value)
Parameters
Type |
Name |
Description |
UInt64 |
value |
|
Write<T>(String, IReadOnlyDictionary<String, T>)
Write a named struct to the stream
Declaration
public void Write<T>(string name, IReadOnlyDictionary<string, T> dict)
Parameters
Type Parameters
Write<T>(String, IReadOnlyList<T>)
Write a named cell vector to the stream
Declaration
public void Write<T>(string name, IReadOnlyList<T> array)
Parameters
Type Parameters
WriteArray(String, Array)
Write a named array to the stream
Declaration
public void WriteArray(string name, Array array)
Parameters
WriteFromCsv(String, String)
Write a named struct whose fields are the columns of a csv file
Declaration
public void WriteFromCsv(string name, string path)
Parameters
WriteFromCsvFolder(String, String)
Declaration
public static void WriteFromCsvFolder(string outputFilename, string inputFolder)
Parameters
Type |
Name |
Description |
String |
outputFilename |
|
String |
inputFolder |
|
Declaration
protected void WriteMatrixHeader(string name, int rows, int cols, mxClass dataClass, int elementSize, bool isComplex = false, bool isLogical = false)
Parameters
Implements