Using system() or ! with deployed executable
4 次查看(过去 30 天)
显示 更早的评论
I've written a script that allows the user to select multiple folders then sequentially:
1) feed those folders into an external executable (which only accepts one folder at a time) that takes a significant amount of time to run,
2) perform work on the files generated by the external executable once it's done
The script works great on my PC, as does the executable generated by mcc.
My problem is that when I attempt to run this program on other PCs that only have MCR, not full MATLAB, the system calls are not functioning at all. I have ensured that the paths are correct, and verified that the MCR PC can indeed run the command. To verify this, I called the deployed executable from a command line so the output would persist. I included a line that simply writes the argument I'm using for the system() call before making the system call, then running that string directly after the deployed executable finishes.
Unfortunately this is work related and I'm prohibited from posting the actual code, but in my debug process I've tried the following:
c = 'Super\secret\command_line_program arguments';
c
system(c)
dos(c)
eval(['!' c])
I get
ans =
'Super\secret\command_line_program arguments'
ans =
-1
ans =
-1
ans =
-1
I can further verify the super secret command line program is not executing because the files it would generate are not being generated. When I copy the content of variable c and paste it directly to the MCR PC's command line, it executes the program as expected.
Can someone help me figure out what I'm doing wrong?
Bonus question: Any idea why my mcc calls are taking 12+ minutes to run for literally as little as 2 lines of code?
mcc -mv debugTestScript.m
Matlab 2017a, Compiler 6.4
Thanks in advance!
5 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!