Regarding exe file created from Matlab Compiler.

1 view (last 30 days)
I am currently in last semester of B.E. and my project is based on gesture recognition. So I have done blob analysis to identify rgb color tape. So by these three colors I can create different gestures. By every gestures I can do different activities like mouse move, left click, right click, drag and drop and many other things. Now I want to create windows standalone application using Matlab Compliler. I had follow the same procedure. First add main file, install MCR. But still there are several issues. The issues are as below:
  1. After creating .exe file, to run that file it would take lot of time. I don't know why is this so?
  2. This would be major one. Well, in .m file I have used red and blue color to do several actions. I have called java class for that. ".m" file runs completely fine. But the same thing for .exe there is problem. I have run the .exe file.
(Info: To move the mouse I have used single red color and for left and right click I have used red and blue color together.) In .exe file if I take red color in front of webcam to move mouse then it will run. But whenever I take blue color with red color in front of webcam to do right click or left click then .exe file gets terminated. I don't know why my .exe file gets terminated. Please help me with this.

Accepted Answer

Walter Roberson
Walter Roberson on 18 May 2013
Running the .exe file takes a long time because .exe files produced using MATLAB Compiler are more or less just MATLAB sessions without the command prompt or desktop, and so the .exe files take as long to start up as a MATLAB session takes.
We do not know enough about your code to be able to guess why your program crashes when you use blue. Is any error message produced? Have you tried creating a console version and running it within a Windows command shell to see if you can see any messages ? Have you tried outputting status updates as variables portions are executed so that you can isolate which section of the code is failing ?
  6 Comments
Rushabh Shah
Rushabh Shah on 19 May 2013
Ya error message displayed is "Undefined variable InputEvent or Undefined Function InputEvent.Button1_MASK".So what would be the error?I don't know.Does it regarding to Java class?Help me to solve this error.
Rushabh Shah
Rushabh Shah on 27 May 2013
Thank you Walter Roberson.I finally able to solve my problem and my project runs perfect.Thank you for your help.Thank you to Image Analyst.

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 18 May 2013
Regarding crashes, run it in a console window like Walter recommends. Also, make sure your functions have a try/catch so you can see what went wrong.
try
% Some code that may produce an error.
catch ME
errorMessage = sprintf('Error in function blah_blah_blah().\n\nError Message:\n%s', ME.message);
fprintf(1, '%s\n', errorMessage);
uiwait(warndlg(errorMessage));
end

Products

Community Treasure Hunt

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

Start Hunting!