how to convert matlab code to .exe file?

hi...i have a matlab code(.m) which i want to convert to .exe.. i used deploytool to make a package which conatins .exe and MCR installer. but the .exe file created is a matlab application. It is "Application(.exe)"!!!
and it does not work with only MCR but it needs malab installed in the system.
somebody please help me with this.. i want to make a .exe file from matlab code!

댓글 수: 1

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 16일
편집: Azzi Abdelmalek 2013년 2월 16일
Have you checked if your .exe file works in your first computer?

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2013년 2월 16일

0 개 추천

Please run your app from a console window (Start->cmd, then cd to the folder). Tell us everything in the console window that you see.

댓글 수: 3

Jeena
Jeena 2013년 2월 16일
i tried in console window as u said...the error is in reading the image! error is '_ image does not exist_' . '_imread_' cant read the image as the path i have given in the program is not there in the system. image was stored in the desktop.
Image Analyst
Image Analyst 2013년 2월 16일
편집: Image Analyst 2013년 2월 16일
Well, there you go. You did write robust code, didn't you? So that it didn't crash the program? Meaning, you did have try/catch constructs to trap errors, try to fix them, and continue? And you used exist() before you try to open any files (images, Excel workbooks, data files, .mat files, etc.)?
if ~exist(theFolder, 'dir')
warningMessage = sprintf('Error: folder does not exist:\n%s', theFolder);
uiwait(warndlg(warningMessage));
theFolder = pwd; % Default to the current working directory.
end
fullFileName = fullfile(theFolder, baseFileName);
if exist(fullFileName, 'file')
originalImage = imread(fullFileName);
else
warningMessage = sprintf('Error: file does not exist:\n%s', fullFileName);
uiwait(warndlg(warningMessage));
originalImage = zeros(240, 320); % Just make a black image so we can continue.
end
If not, then you need to learn and start using more robust, bulletproof code or else your users will complain over and over about numerous places where your code crashed. This will damage your reputation with your users.
Jeena
Jeena 2013년 2월 17일
thank you sir...i understood the mistake in code!

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 16일

1 개 추천

No, your .exe application, needs only MCR.

댓글 수: 2

Jeena
Jeena 2013년 2월 16일
well the file type in the properties window says it an is "Application(.exe)" not ".exe" !!! It also comes with a matlab icon.
i have tried in a computer which does not have matlab installed. I installed MCR in it and still it didnt work!!
Image Analyst
Image Analyst 2013년 2월 16일
Try renaming the file so that there are no parentheses in the name.

댓글을 달려면 로그인하십시오.

Youssef  Khmou
Youssef Khmou 2013년 2월 16일

0 개 추천

hi,
did you try mcc
doc mcc

댓글 수: 4

Youssef  Khmou
Youssef Khmou 2013년 2월 16일
well, i just tried the same command with random Mfile and it generated 2 C files and one .exe, is your M-file in the dir : \R2012a\bin? if yes then change its location to somewere else like Desktop
Image Analyst
Image Analyst 2013년 2월 16일
편집: Image Analyst 2013년 2월 16일
You can do that in the mcc command line with the -d option:
mcc -m myapp.m -d 'D:\MATLAB\myAppFolder'
The above command will put myapp.exe in the folder called "D:\MATLAB\myAppFolder".
Sukshith Shetty
Sukshith Shetty 2021년 6월 21일
How do I convert .m (matlab file) to .exe file without the help of Application/MATLAB Compiler Toolbox. Is there any other method. I currently don't have the resource to purchase MATLAB Compiler Toolbox. Can you please suggest me an alternate way.
Thank you
Walter Roberson
Walter Roberson 2021년 6월 25일
For some subsets of MATLAB, you might be able to use https://github.com/ebranlard/matlab2fortran and then compile the resulting fortran.
It probably does not handle any of the toolboxes.

댓글을 달려면 로그인하십시오.

mohsen
mohsen 2024년 7월 16일

0 개 추천

I want to mathworks for show the tiutorials video for conver mathlab codes to the .exe filse.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2013년 2월 16일

답변:

2024년 7월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by