Start the MATLAB Runtime and initialize its application state
std::shared_ptr<MATLABApplication>
initMATLABApplication(matlab::cpplib::MATLABApplicationMode mode, const
std::vector<std::u16string>& options =
std::vector<std::u16string>())
matlab.cpplib.initMATLABApplication
accepts as input mode and an
optional array of startup options. It returns a shared pointer to a
MATLABApplication
object. The shared pointer is passed to the
function matlab::cpplib::initMATLABLibrary
, which returns a unique pointer to a
user written library. This unique pointer is then used to call MATLAB® functions from the library
A process should call this method only once.
MATLABApplicationMode mode | Mode in which to start application:
|
const std::vector<std::u16string>&
options | Start up options used to start a MATLAB Runtime. They include:
|
| Pointer to a |
| The function failed to start. |
std::shared_ptr<MATLABApplication> appPtr = initMATLABApplication(MATLABApplicationMode::IN_PROCESS);
std::vector<std::string> opts = {"-nojvm"}; std::shared_ptr<MATLABApplication> appPtr = initMATLABApplication(MATLABApplicationMode::OUT_OF_PROCESS, opts);
std::vector<std::u16string> opts = {u"-logfile", u"C:\\somepath\\matlab_app.log"}; std::shared_ptr<MATLABApplication> appPtr = initMATLABApplication(MATLABApplicationMode::IN_PROCESS, opts);
matlab::cpplib::convertUTF16StringToUTF8String
| matlab::cpplib::convertUTF8StringToUTF16String
| matlab::cpplib::initMATLABLibrary
| matlab::cpplib::initMATLABLibraryAsync
| matlab::cpplib::MATLABLibrary::feval
| matlab::cpplib::MATLABLibrary::fevalAsync
| matlab::cpplib::MATLABLibrary::waitForFiguresToClose
| matlab::cpplib::runMain