32 string method(rhs[0].toString());
35 if (method ==
"from_scalar_int") {
43 else if (method ==
"from_scalar_double") {
51 else if (method ==
"from_scalar_bool") {
59 else if (method ==
"from_string") {
67 else if (method ==
"toMat_row_vector") {
72 const double *data = m.
ptr<
double>();
74 for (
size_t i=0; i<len; i++)
78 else if (method ==
"toMat_col_vector") {
83 const double *data = m.
ptr<
double>();
85 for (
size_t i=0; i<len; i++)
89 else if (method ==
"fromMat_row_vector") {
91 Mat m = (
Mat_<double>(1,10) << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
97 else if (method ==
"fromMat_col_vector") {
99 Mat m = (
Mat_<double>(10,1) << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
107 "Unrecognized method %s", method.
c_str());
mwSize ndims() const
Number of dimensions.
mwSize numel() const
Number of elements in an array.
bool isLogicalScalar() const
Determine whether scalar array is of type mxLogical.
bool isChar() const
Determine whether input is string array.
bool isDouble() const
Determine whether mxArray represents data as double-precision, floating-point numbers.
struct mxArray_tag mxArray
Forward declaration for mxArray.
int MexErrorHandler(int status, const char *func_name, const char *err_msg, const char *file_name, int line, void *userdata)
Cutom error callback to be invoked by cv::error(), CV_Assert, etc.
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
ErrorCallback redirectError(ErrorCallback errCallback, void *userdata=0, void **prevUserdata=0)
Global constant definitions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
mwSize rows() const
Number of rows in an array.
mwSize cols() const
Number of columns in an array.