Skip to content

Commit c5c8f52

Browse files
committed
mex: scalar return
1 parent b8806d3 commit c5c8f52

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/is_char_device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ class MexFunction : public matlab::mex::Function {
8585
// actual function algorithm / computation
8686
bool y = fs_is_char_device(inputStr);
8787

88-
// convert to Matlab output -- even scalars are arrays in Matlab
88+
// convert to Matlab output
8989
// https://www.mathworks.com/help/matlab/matlab_external/create-matlab-array-with-matlab-data-cpp-api.html
9090
// https://www.mathworks.com/help/matlab/apiref/matlab.data.arrayfactory.html
9191

92-
outputs[0] = factory.createArray<bool>({1,1}, {y});
92+
outputs[0] = factory.createScalar<bool>(y);
9393
}
9494
};

src/is_symlink.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ class MexFunction : public matlab::mex::Function {
6767
// actual function algorithm / computation
6868
bool y = fs_is_symlink(inputStr);
6969

70-
// convert to Matlab output -- even scalars are arrays in Matlab
70+
// convert to Matlab output
7171
// https://www.mathworks.com/help/matlab/matlab_external/create-matlab-array-with-matlab-data-cpp-api.html
7272
// https://www.mathworks.com/help/matlab/apiref/matlab.data.arrayfactory.html
7373

74-
outputs[0] = factory.createArray<bool>({1,1}, {y});
74+
outputs[0] = factory.createScalar<bool>(y);
7575
}
7676
};

src/set_permissions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class MexFunction : public matlab::mex::Function {
9292
// actual function algorithm / computation
9393
bool y = fs_set_permissions(inputStr, inputs[1][0], inputs[2][0], inputs[3][0]);
9494

95-
// convert to Matlab output -- even scalars are arrays in Matlab
95+
// convert to Matlab output
9696
// https://www.mathworks.com/help/matlab/matlab_external/create-matlab-array-with-matlab-data-cpp-api.html
9797
// https://www.mathworks.com/help/matlab/apiref/matlab.data.arrayfactory.html
9898

99-
outputs[0] = factory.createArray<bool>({1,1}, {y});
99+
outputs[0] = factory.createScalar<bool>(y);
100100
}
101101
};

0 commit comments

Comments
 (0)