Why my MATLAB Standalone Application can work on my computer but cannot run on others
이전 댓글 표시
I have created an standalone .exe using matlab. I know that if others want to use my .exe then they need to install the correct version for MCR. For example, my matlab version is R2016a and the MCR version is 9.0.1. However, when my friend correctly installed the MCR and try to run my program, it just didn't get him the correct answer. Moreover, when we limit the size of our input(i.e. from 100 records to 1 record), the error message even changed which doesn't make any sense. I am just thinking that my application is not functioning correctly on his computer. Could someone can tell me beside install MCR, is there any other things I need to do to make sure my program could run? Thanks.
댓글 수: 3
Walter Roberson
2018년 2월 28일
Do you link into any external libraries that you know of?
Is the other system possibly a different manufacturer of CPU? AMD vs Intel? (This can make a difference if heavy mathematics functions are used.)
Daniel Wang
2018년 2월 28일
Walter Roberson
2018년 2월 28일
What error messages are showing up?
답변 (2개)
Image Analyst
2018년 2월 28일
1 개 추천
See the FAQ: http://matlab.wikia.com/wiki/FAQ#My_standalone_executable_won.27t_run_on_the_target_computer._What_can_I_try.3F
If none of that solves it, tell us what you see in the system console window when your compiled program runs.
댓글 수: 2
Daniel Wang
2018년 2월 28일
편집: Daniel Wang
2018년 2월 28일
Image Analyst
2018년 3월 1일
Do you mean that it launches and runs just fine, with no errors whatsoever, but the numerical "answer" it reports is a different number than you expect?
Léolo Gonay
2018년 3월 1일
0 개 추천
Hi all !
I may use your help on a similar (I guess) issue. I've built a Matlab application and used the Matlab Compiler to make a standalone application. Basically is just a GUI to change parameters and IC of a ode system (solve with ode23s).
When I download and install in on my computer, I manage to launch the app, use the different buttons or toggles, everything looks fine, but as soon as I press "run" (which i suppose to run the ode solver, that is to say the ode23s function) the function seems to run for ever, while it is suppose to take less than 1 sec.
Do you have any idea where it could come from ? Or is it normal that the program takes a (really) longer time to compute the solution?
Best wishes,
Léolo
댓글 수: 6
Image Analyst
2018년 3월 2일
The first time your app launches, it takes a really long time (2-3 minutes or so) because it has to unpack a bunch of stuff and create files.
After that first time it will just take a long time (like a minute or so) because it only has to load the MCR, but that's really big.
When you run from the MATLAB development environment, it doesn't have to do that since the MATLAB functions are already in memory.
Léolo Gonay
2018년 3월 5일
Hi !
Thanks for this answer ! Unfortunately, the app takes way more that 2-3 minutes (actually, it is still running). The code is still quite simple and I would find it really odd if we would actually have to wait for dozens of minute to get some results.
Best regards,
Léolo
Walter Roberson
2018년 3월 5일
편집: Walter Roberson
2018년 3월 5일
temporarily change the ode*() call to include plotfcn or outputfcn in the options to plot the progress so that you can get an idea of what is taking so long.
Léolo Gonay
2018년 3월 5일
I'll try this. I'll get back to you if I'm still facing some issues !
Thanks again,
Léolo
Léolo Gonay
2018년 3월 5일
Hi again (that was fast).
So here is what I get, almost instantaneously, when I "click on run", which is exactly what I get when using the app on my computer.

However, the solver seems to keep running (see following screenshot. It should display the elapsed time and not "Running" anymore ...

Any thoughts on this one ?
Best regards,
Léolo
Walter Roberson
2018년 3월 5일
I would suggest putting in a try/catch block just in case it is somehow crashing. That will not catch any kind of endless loop though.
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!