How can I utilize the MATLAB Compiler Runtime (MCR) User Data Interface to pass values between the MATLAB code and the wrapper code while using the MATLAB Compiler 4.10 (R2009a)?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 2 Nov 2009
Edited: MathWorks Support Team
on 7 Feb 2017
In the MATLAB Compiler 4.10 (R2009a) help file, there is a section that is entitled "Improving Data Access Using the MCR User Data Interface." It would be helpful to include an example on how to use this.
https://in.mathworks.com/help/releases/R2009a/toolbox/compiler/br2jauc-31.html#br2jauc-41
You may access the same page locally by typing the following at the MATLAB R2009a prompt:
web([docroot,'/toolbox/compiler/br2jauc-31.html#br2jauc-41'])
Specifically, I wish to define a structure in MATLAB and pass that information into C-code.
Accepted Answer
MathWorks Support Team
on 7 Feb 2017
The concept is illustrated using an example. For this, download the four attached files: compileRun.m, magicdriver.c, structTest_init.m, structTest2.m.
Steps:
1. Open compileRun.m
2. This file creates a shared library using the MATLAB files, compiles the driver program, and then runs the executable which shares a structure data created in MATLAB with the driver in C.
0 Comments
More Answers (0)
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!