19#ifndef GNSS_SDR_MATLAB_WRITTER_HELPER_H
20#define GNSS_SDR_MATLAB_WRITTER_HELPER_H
31 static constexpr matio_classes class_type = MAT_C_INT32;
32 static constexpr matio_types data_type = MAT_T_INT32;
38 static constexpr matio_classes class_type = MAT_C_UINT32;
39 static constexpr matio_types data_type = MAT_T_UINT32;
45 static constexpr matio_classes class_type = MAT_C_UINT8;
46 static constexpr matio_types data_type = MAT_T_UINT8;
52 static constexpr matio_classes class_type = MAT_C_INT64;
53 static constexpr matio_types data_type = MAT_T_INT64;
59 static constexpr matio_classes class_type = MAT_C_UINT64;
60 static constexpr matio_types data_type = MAT_T_UINT64;
66 static constexpr matio_classes class_type = MAT_C_SINGLE;
67 static constexpr matio_types data_type = MAT_T_SINGLE;
73 static constexpr matio_classes class_type = MAT_C_DOUBLE;
74 static constexpr matio_types data_type = MAT_T_DOUBLE;
78template <
size_t Rank,
typename T>
79void write_matlab_var(
const char* name, T data, mat_t* matfp, std::array<size_t, 2>& dims)
82 matvar_t* matvar = Mat_VarCreate(name, traits::class_type, traits::data_type, Rank, dims.data(), &data, 0);
83 Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);
88template <
size_t Rank,
typename T>
89void write_matlab_var(
const char* name, T* data, mat_t* matfp, std::array<size_t, 2>& dims)
92 matvar_t* matvar = Mat_VarCreate(name, traits::class_type, traits::data_type, Rank, dims.data(), data, 0);
93 Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB);