15 #include <mrpt/config.h> 34 template <
typename MATRIX>
37 const size_t m = mat.rows(), n = mat.cols();
38 mxArray* mxa = mxCreateDoubleMatrix(m, n, mxREAL);
40 double* mxa_data = mxGetPr(mxa);
41 for (
size_t j = 0; j < n; j++)
42 for (
size_t i = 0; i < m; i++)
43 *mxa_data++ = mat.coeff(i, j);
49 template <
typename CONTAINER>
52 const size_t m = vec.size(), n = 1;
53 mxArray* mxa = mxCreateDoubleMatrix(m, n, mxREAL);
55 double* mxa_data = mxGetPr(mxa);
56 for (
size_t i = 0; i < m; i++)
This base provides a set of functions for maths stuff.
mxArray * convertVectorToMatlab(const CONTAINER &vec)
Convert std::vector<> or std::deque<> of numeric types into Matlab vectors.
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) ...
mxArray * convertToMatlab(const MATRIX &mat)
Convert vectors, arrays and matrices into Matlab vectors/matrices.