File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,33 @@ void create_property(const extractor &input, infusor &output)
68
68
void create_property_with_value (const extractor &input, infusor &output)
69
69
{
70
70
nix::Section currObj = input.entity <nix::Section>(1 );
71
- std::vector<nix::Value> currVec = input.vec (3 );
71
+
72
+ std::vector<nix::Value> currVec;
73
+
74
+ mxClassID currID = input.class_id (3 );
75
+ if (currID == mxCELL_CLASS){
76
+ mexPrintf (" Cell\n " );
77
+ const mxArray *cell_element_ptr = input.cellElemPtr (3 , 0 );
78
+
79
+ if (mxGetClassID (cell_element_ptr) == mxSTRUCT_CLASS){
80
+ mexPrintf (" Struct\n " );
81
+ currVec = input.extractFromStruct (3 );
82
+ }
83
+ else
84
+ {
85
+ mexPrintf (" Cell with normal values\n " );
86
+ currVec = input.vec (3 );
87
+ }
88
+ }
89
+ else if (currID == mxCHAR_CLASS){
90
+ mexPrintf (" Just char\n " );
91
+ }
92
+ else if (currID == mxDOUBLE_CLASS){
93
+ mexPrintf (" Just double\n " );
94
+ }
95
+ else if (currID == mxLOGICAL_CLASS){
96
+ mexPrintf (" Just logical\n " );
97
+ }
72
98
73
99
nix::Property p = currObj.createProperty (input.str (2 ), currVec);
74
100
output.set (0 , handle (p));
Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ class extractor : public argument_helper<const mxArray> {
65
65
return mx_array_to_str (array[pos]);
66
66
}
67
67
68
+ const mxArray * cellElemPtr (size_t pos, int index) const {
69
+ const mxArray *cell_element_ptr = mxGetCell (array[pos], index);
70
+ return cell_element_ptr;
71
+ }
72
+
68
73
template <typename T>
69
74
T num (size_t pos) const {
70
75
check_arg_type (pos, nix::to_data_type<T>::value);
You can’t perform that action at this time.
0 commit comments