Skip to content

Commit 004ac55

Browse files
committed
Merge pull request #1426 from terfendail:matlab_readme
2 parents d3118ad + 0e56148 commit 004ac55

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/matlab/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void mexFunction(int nlhs, mxArray* plhs[],
7373

7474
// add an argument parser to automatically handle basic options
7575
ArgumentParser parser("my function");
76-
parser.addVariant(1, 1, "opt");
76+
parser.addVariant("variant1", 1, 1, "opt");
7777
MxArrayVector reordered = parser.parse(raw);
7878

7979
// if we get here, we know the inputs are valid and reordered. Unpack...
@@ -90,7 +90,8 @@ void mexFunction(int nlhs, mxArray* plhs[],
9090
}
9191

9292
// allocate an output
93-
Bridge out = required;
93+
Bridge out;
94+
out = required;
9495
plhs[0] = out.toMxArray().releaseOwnership();
9596
}
9697
```
@@ -363,7 +364,7 @@ then you can create an `ArgumentParser` as follows:
363364
364365
```cpp
365366
ArgumentParser parser("f");
366-
parser.addVariant(2, 2, "mask", "dtype");
367+
parser.addVariant("f", 2, 2, "mask", "dtype");
367368
MxArrayVector inputs = parser.parse(prhs, prhs+nrhs);
368369
```
369370

0 commit comments

Comments
 (0)