How do I call external applications via "system" command in standalone apps compiled with MATLAB Compiler?
Show older comments
I use the system function to execute a third-party application (.exe) and a Windows system command in my MATLAB code.
My code works fine in MATLAB Desktop. But after I compile it as a standalone application using MATLAB Compiler, it doesn't work as expected.
As an example, here is my code. I use the Windows wmic command to find COM port object. When the code is compiled, no COM port can be detected.
% Search win 32 serial port object
[~, res1] = system('wmic path Win32_SerialPort Get Caption | findstr "COM"');
% Search win 32 plug and play object (with COM in name)
[~, res2] = system('wmic path Win32_PnPEntity Get Caption | findstr "COM"');
Accepted Answer
More Answers (0)
Categories
Find more on COM Component Integration 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!