write_matrixT_write_matrixWriteMatrixWriteMatrixwrite_matrix (算子)

名称

write_matrixT_write_matrixWriteMatrixWriteMatrixwrite_matrix — 将矩阵写入文件。

签名

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)

def write_matrix(matrix_id: HHandle, file_format: str, file_name: str) -> None

描述

算子 write_matrixwrite_matrixWriteMatrixWriteMatrixWriteMatrixwrite_matrix writes a matrix to the file FileNameFileNameFileNameFileNamefileNamefile_name. The matrix can be read with read_matrixread_matrixReadMatrixReadMatrixReadMatrixread_matrix。The default HALCON file extension for the matrix is 'mtx'. The format of the file can be selected via the parameter FileFormatFileFormatFileFormatFileFormatfileFormatfile_format. The following values are supported: 'binary'"binary""binary""binary""binary""binary" for a binary file format, and 'ascii'"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.

执行信息

参数

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (输入控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

输入矩阵的矩阵句柄。

FileFormatFileFormatFileFormatFileFormatfileFormatfile_format (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Format of the file.

默认值: 'binary' "binary" "binary" "binary" "binary" "binary"

值列表: 'ascii'"ascii""ascii""ascii""ascii""ascii", 'binary'"binary""binary""binary""binary""binary"

FileNameFileNameFileNameFileNamefileNamefile_name (输入控制)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name.

File extension: .mtx

结果

如果文件名有效(具有写入权限),算子 write_matrixwrite_matrixWriteMatrixWriteMatrixWriteMatrixwrite_matrix 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

模块

基础