Why does engOpen return before MATLAB is finished initializing when MATLAB calls a system command on startup?
1 view (last 30 days)
Show older comments
Why does engOpen return before MATLAB is finished initializing when MATLAB calls a system command on startup?
As part of my matlabrc.m or startup.m, MATLAB makes a call to a system command via the DOS, UNIX, or SYSTEM functions. My call to engOpen returns before that command is done processing therefore its return values are not initialized in the MATLAB workspace.
This behavior is limited to calls to DOS or SYSTEM that MATLAB performs on startup.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This enhancement has been incorporated in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This has been verified as a bug in MATLAB 6.5 (R13) in the way that the MATLAB Engine evaluates calls to system functions. As a workaround, set a flag after the system call has terminated and test that before proceeding with your MATLAB Engine application.
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown 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!