Commit 004ac553 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #1426 from terfendail:matlab_readme

parents d3118ad0 0e561487
...@@ -73,7 +73,7 @@ void mexFunction(int nlhs, mxArray* plhs[], ...@@ -73,7 +73,7 @@ void mexFunction(int nlhs, mxArray* plhs[],
// add an argument parser to automatically handle basic options // add an argument parser to automatically handle basic options
ArgumentParser parser("my function"); ArgumentParser parser("my function");
parser.addVariant(1, 1, "opt"); parser.addVariant("variant1", 1, 1, "opt");
MxArrayVector reordered = parser.parse(raw); MxArrayVector reordered = parser.parse(raw);
// if we get here, we know the inputs are valid and reordered. Unpack... // if we get here, we know the inputs are valid and reordered. Unpack...
...@@ -90,7 +90,8 @@ void mexFunction(int nlhs, mxArray* plhs[], ...@@ -90,7 +90,8 @@ void mexFunction(int nlhs, mxArray* plhs[],
} }
// allocate an output // allocate an output
Bridge out = required; Bridge out;
out = required;
plhs[0] = out.toMxArray().releaseOwnership(); plhs[0] = out.toMxArray().releaseOwnership();
} }
``` ```
...@@ -363,7 +364,7 @@ then you can create an `ArgumentParser` as follows: ...@@ -363,7 +364,7 @@ then you can create an `ArgumentParser` as follows:
```cpp ```cpp
ArgumentParser parser("f"); ArgumentParser parser("f");
parser.addVariant(2, 2, "mask", "dtype"); parser.addVariant("f", 2, 2, "mask", "dtype");
MxArrayVector inputs = parser.parse(prhs, prhs+nrhs); MxArrayVector inputs = parser.parse(prhs, prhs+nrhs);
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment