How to convert .m file to .exe file?
조회 수: 4 (최근 30일)
이전 댓글 표시
I converted .m file to .exe file using deploytool. When i run .exe file it opens with logo and just after that it close. Its not through any error or warning message. I am not able to figure out why its happening!! .m file contains classdef, in which using uicontrol i am creating GUI. Is it because i don't have any .fig file ? Thanks!
댓글 수: 6
채택된 답변
Steven Lord
2018년 4월 12일
Does your GUI use uiwait or waitfor to pause execution until the GUI is closed? If it does not, I believe what's happening is that the executable is opening your GUI and as soon as the GUI's program file finishes executing it exits, closing all figures as part of its shutdown process. [If it didn't, it would leak memory and graphics handles.] Adding uiwait or waitfor will prevent the GUI's program file from finishing until you close the GUI figure, and that would keep the executable running while you interact with your GUI.
If your GUI does use uiwait or waitfor, try launching the executable by typing its name at your operating system's command prompt rather than double-clicking on its icon. If it experiences an error on startup, that should display the message at the prompt. That may suggest a solution to you, or you can copy it into a comment on this question and that may suggest a solution to some of the people reading this discussion.
댓글 수: 4
Steven Lord
2018년 4월 12일
I tried building the application in release R2018a using the code you posted and was able to get a running application that left the figure on screen until I closed it myself. If you're not seeing the same results, you may want to contact Technical Support and work with them to determine why your results are different from mine. Use the Contact Us link in the upper-right corner of this page to contact Support.
추가 답변 (1개)
Veera Kanmani
2018년 4월 12일
https://in.mathworks.com/matlabcentral/answers/318886-how-can-i-create-exe-file-from-m-file
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!