code runs perfectly in matlab, compiles in matlab compiler 4.14 perfetly, starts running, runs perfect in all functions, yet freezes when operating one specific task...

I am using Matlab 2010 , 32 bit.... It is installed on a 64 bit windows 7....
All my work is done through the 32 bit domain, there is no 64 intereference. Only the destination of the file is directly on C.
I have several m files, that I compiled using Matlab compiler 4.14 (included in matlab).... I made sure I added all the paths to the main file, and the program compiles perfectly....
I have to mention that the program runs perfectly when its directly run from matlab.
However, when I compile the program, and produce the exe file (windows standalone application), all parts of the GUI seem to be working fine, such as the open, view camera, play movie and so on....
When I press Record movie, the exe file freezes, and it shows the the file is "Not Responding". I end up "ending the task" of the exe file to exit the whole thing.
I donwloaded visual C++ , and sdk, yet did not help. I went as far as downloading java , and stilll , nothing.
What i can't get over is that the program works perfectly when run through matlab directly.
When a coding error occurs, i hear a beep in my speakers, to know the this was a coding issue. Yet i hear no beep when it is frozen.
My two questions are:
1- Previous Matlab compiler versions included the DOS so i would be able to track the error and read what happens. This is not the case in this compiler. I cant track the error, i have to depend on hearing the beep. How do i include the DOS with the launch of the exe so i would visually see the error.
2- Let say that there is no error whatsover, why does it freeze when there are no problems when executed through matlab directly?
I appreraciate all the help.

6 Kommentare

What specific MATLAB commands do you run for "Record" - are you able to reproduce the issue when you whittle down (if that is possible) your compiled code to just that part?
Are you compiling using mcc or deploytool? If using mcc, ensure that you either don't use the -e option, or use the -R log_file option in addition to -e, so any errors/warnings are logged in a text file. If using deploytool, you are probably compiling as a Windows Console Application. Pick the option that says just Console Application.
Are you double-clicking on the EXE to execute it? If there are any MATLAB errors, you should be able to see them if you run your compiled EXE from the Windows Command Prompt rather than double-clicking on it.
Are you running the EXE on the same machine which has MATLAB installed? If so, try running the EXE from within MATLAB using the '!' operator as below:
>>!myexe.exe
Does that also produce the same behavior?
I am using deploytool.... The record function is basically snapshots that are added using the addframe command... Under each frame, image proccesing techniques are in the works....
So basically, each new measurement will output the video ( frames added , fps=30 ) and plots using the data computed from the image processing techniques....
Videos are compressed using the DivX codec. All issues from the codecs have been setted in the Matlab domain. So technically, I highly doubt its a coding/video/codec issue.
With that being said, when I click on the record button in the matlab domain, the mouse cursor acts busy for a couple of seconds, then sends me to the record video page.
However, when using the compiler, the mouse cursor acts busy for good. It might be a Matlab memory issue. After which, the whole program stops responding, and i would have to "End Task" the whole file.
Again, launching the program along with the DOS prompt will ease up my life. I would be able to witness everything that might go wrong with the program. Yet again, it runs smoothly directly in matlab, so i dont know where the issue is.
Is there a memory limit on the compiler? I'm working on a i5 system, 6 GB memory. However, since its a 32 bit system, the maximum memory might be 4 when its operating the compiler.
Thanks again.
@Saurabh ..... Thanks for the reply... I just forced an error with my code, and the command prompt recognized it as you mentioned. Thanks for the tip.
However, when I execute the same function as i mentioned before, it still freezes, and there are no errors outputted... Just the good ol windows 7 freezing.
Moreover, I tried the ! tool to run the exe directly from the matlab command window.... Again, it did not work. Not Responding, and the mouse cursor is still circuling.
Charles: I don't know of any issues in deployed applications with addframe, but it might be worth putting in some "disp" statements in your code to monitor the progress - this might help you narrow down the issue. Also, you can use "memory" to monitor available memory.
I would suggest using the Windows Dependency Walker, http://www.dependencywalker.com/ to cross-check that all needed functions are in place.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

I figured it out the next day....
I sat down debugging every line of the code step by step....
The freezing occured when a "uicontrol" was used, and the button on the uicontrol launched the video recording mode.
As soon as I press "Record", the uicontrol window is closed, and the recording mode is directly run after that.
What i did is closed the uicontrol window, paused the code for 2 seconds, and ran the video recording after that.
In the matlab compiler, without a pause, the code would start recording, yet it would still try to exit the uicontrol.... Which causes the freezing.
Who would have known that a simple pause function could go all the way.
A big thanks to all who shared comments and had suggestions.

Weitere Antworten (1)

Hi, I also installed MATLAB 2010 version of 32 bit on 64 bit window 7 ultimate. But it need MATLAB Compiler 4.14 for processing the code. you already have Compiler 4.14 please can you forward me that.
really Thanks

Kategorien

Mehr zu Get Started with MATLAB Compiler finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 5 Mai 2011

Beantwortet:

am 14 Jan. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by