diff --git a/src/mcxlab.cpp b/src/mcxlab.cpp index 94d2697c..d3fb4199 100644 --- a/src/mcxlab.cpp +++ b/src/mcxlab.cpp @@ -654,8 +654,8 @@ void mcx_set_field(const mxArray* root, const mxArray* item, int idx, Config* cf } else if (strcmp(name, "srcparam1") == 0) { arraydim = mxGetDimensions(item); - if (arraydim[0] == 0 || arraydim[1] != 4) { - mexErrMsgTxt("the 'srcparam1' field must have 4 columns"); + if (arraydim[0] == 0 || (arraydim[1] != 3 && arraydim[1] != 4)) { + mexErrMsgTxt("the 'srcparam1' field must have 3-4 columns"); } double* val = mxGetPr(item); @@ -689,8 +689,8 @@ void mcx_set_field(const mxArray* root, const mxArray* item, int idx, Config* cf } else if (strcmp(name, "srcparam2") == 0) { arraydim = mxGetDimensions(item); - if (arraydim[0] == 0 || arraydim[1] != 4) { - mexErrMsgTxt("the 'srcparam2' field must have 4 columns"); + if (arraydim[0] == 0 || (arraydim[1] != 3 && arraydim[1] != 4)) { + mexErrMsgTxt("the 'srcparam2' field must have 3-4 columns"); } double* val = mxGetPr(item); diff --git a/src/pmcx.cpp b/src/pmcx.cpp index b842fa89..3b99c00a 100644 --- a/src/pmcx.cpp +++ b/src/pmcx.cpp @@ -553,8 +553,8 @@ void parse_config(const py::dict& user_cfg, Config& mcx_config) { arraydim[1] = buffer_info.shape.at(1); } - if (arraydim[0] == 0 || arraydim[1] != 4) { - throw py::value_error("the 'srcparam1' field must have 4 columns"); + if (arraydim[0] == 0 || (arraydim[1] != 3 && arraydim[1] != 4)) { + throw py::value_error("the 'srcparam1' field must have 3-4 columns"); } auto val = static_cast(buffer_info.ptr); @@ -600,8 +600,8 @@ void parse_config(const py::dict& user_cfg, Config& mcx_config) { arraydim[1] = buffer_info.shape.at(1); } - if (arraydim[0] == 0 || arraydim[1] != 4) { - throw py::value_error("the 'srcparam2' field must have 4 columns"); + if (arraydim[0] == 0 || (arraydim[1] != 3 && arraydim[1] != 4)) { + throw py::value_error("the 'srcparam2' field must have 3-4 columns"); } auto val = static_cast(buffer_info.ptr);