write_matrixT_write_matrixWriteMatrixWriteMatrix (Operator)


write_matrixT_write_matrixWriteMatrixWriteMatrix — Write a matrix to a file.


write_matrix( : : MatrixID, FileFormat, FileName : )

Herror T_write_matrix(const Htuple MatrixID, const Htuple FileFormat, const Htuple FileName)

void WriteMatrix(const HTuple& MatrixID, const HTuple& FileFormat, const HTuple& FileName)

void HMatrix::WriteMatrix(const HString& FileFormat, const HString& FileName) const

void HMatrix::WriteMatrix(const char* FileFormat, const char* FileName) const

void HMatrix::WriteMatrix(const wchar_t* FileFormat, const wchar_t* FileName) const   (Windows only)

static void HOperatorSet.WriteMatrix(HTuple matrixID, HTuple fileFormat, HTuple fileName)

void HMatrix.WriteMatrix(string fileFormat, string fileName)


The operator write_matrixwrite_matrixWriteMatrixWriteMatrixWriteMatrix writes a matrix to the file FileNameFileNameFileNameFileNamefileName. The matrix can be read with read_matrixread_matrixReadMatrixReadMatrixReadMatrix. The default HALCON file extension for the matrix is 'mtx'. The format of the file can be selected via the parameter FileFormatFileFormatFileFormatFileFormatfileFormat. The following values are supported: 'binary'"binary""binary""binary""binary" for a binary file format, and 'ascii'"ascii""ascii""ascii""ascii" for a ascii text format. In the text format each row of the file contains one row of the matrix. The columns are separated with white spaces. The advantage of using the binary file format instead of the ascii text format is a smaller size of the output file.

Execution Information


MatrixIDMatrixIDMatrixIDMatrixIDmatrixID (input_control)  matrix HMatrix, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the input matrix.

FileFormatFileFormatFileFormatFileFormatfileFormat (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Format of the file.

Default value: 'binary' "binary" "binary" "binary" "binary"

List of values: 'ascii'"ascii""ascii""ascii""ascii", 'binary'"binary""binary""binary""binary"

FileNameFileNameFileNameFileNamefileName (input_control)  filename.write HTupleHTupleHtuple (string) (string) (HString) (char*)

File name.

File extension: .mtx


If the file name is valid (write permission), the operator write_matrixwrite_matrixWriteMatrixWriteMatrixWriteMatrix returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Possible Predecessors