write_mat#

Write an operator to a MAT file

Note

This function requires the optional MATX_ENABLE_FILEIO compile flag

template<typename TensorType>
void matx::io::write_mat(const TensorType &t, const std::string fname, const std::string var)#

Write a MAT file from a tensor view.

Writes a single tensor value into a .mat file.

Template Parameters:

TensorType – Data type of tensor

Parameters:
  • t – Tensor to read data into

  • fname – File name of .mat file

  • var – Variable name to save inside of mat file

Examples#

io::write_mat(t, "test_write.mat", "myvar");