I have just installed Matlab R2011a on Ubuntu 12.04 using a standalone licence. The installation appears to have worked properly, and I have run the following to get rid of an error that everyone (including myself) seemed to be having:
This got rid of the error, but I still have a problem launching Matlab. Each time I launch it (by typing "matlab" in terminal), the Mathworks software activation window pops up. I provide the path to the licence file, it appears to activate successfully (no errors), but then Matlab doesn't launch. If I try to run it again, the same thing happens.
I think the licence should be updated. I fixed the problem by requesting a new licence from Mathworks and activating MATLAB with that licence file. They provided the same installation key for my computer's host id, but the 'licence.lic' file is updated. I think reinstallation is not necessary, activation with an updated licence just solves the problem.
Try running /usr/local/MATLAB/R2011a/bin/matlab (change the path according to the location on your system) in the terminal to see if that runs MATLAB. If not, perhaps you can still get some error messages from there that might be useful for your question.
After toying around with the activation client I finally have a good answer as to why MATLAB will not activate. Here are the steps to getting everything working!! This is also assuming that you have MATLAB installed and cannot get it to launch.
Do everything you did before except this time at the end of the activation when it asks you to type in the name of your computers user, you need to type root, instead of your username or instead of anything you want to put.
Old thread I know, but I just had this same problem. The problem for me at least, was that it is recommended installing matlab with root priviledges and as such when it came to activation the default user to be granted a licens became root. In this way I could only start matlab when logged in as root. Problem is easily fixed by running the activation again outside of root.
Once you have deleted all files within these folders, try launching MATLAB again. Launch it as your regular username, not as sudo or root. You will be prompted to activate once more. Complete the process one last time. Take note on the screen in the activation where it asks you for your Linux username. This should be detected automatically, and you should not change it.
But my complaint is that the GUI window shows up too slow, and when I check
the task manager, the memory usage keeps increasing slowly, and once it gets to
certain point it stops increasing and showing the GUI window that I made.Obviously, I think it takes too much time, but I wonder the some preparation
step to launch the GUI window usually takes such a bit of time.Any comments would be appreciated.--
Isn't 30 secs a lot, and enough time for users being curious if the program is really running or not ? I often had to open the task manager to see what's going on. Maybe, I am too impatient.And, I am wondering, if there is anyway for me to open up an image window real quick when I execute the program, and later on my main GUI window comes up, much like executing Matlab ?--
I was wondering the same things! I have put a trace at the beginning of my executable gui. After clicking the exe, it takes 30 seconds to appear. And the worst part is that nothing shows up during this process. Is there any way to decrease this time? I would also like to make a splash screen which appears as soon as executing the program if possible. Any suggestions?
Less than 3 seconds.Opening Matlab has nothing to do with execution, since the application supposes to work on the computer without Matlab. But "the first time"I meant the very first time a newly compiled program is launched, where it needs to unpacked the files and store it somewhere. All successive runs takes 3 seconds - regardless whereas the computer is just restarted or not and Matlab is opened or not.Bruno
This is a known issue with Matlab-compiled applications. In R2011b this problem is supposed to be reduced. But the core issue of having to unpack and load the MCR the first time it is used after a computer restart remains painful. In some cases I observed start-up times of up to a minute (obviously this depends on the specific hardware and CPU load).The work-around that I have successfully used is to create a small wrapper application that simply displays a static "Please wait... Loading XYZ..." splash image (with a generic configuration of the image, size, etc.), then launches the main (compiled) application, and finally deletes the splash image when it detects that the main application has actually started. This gives the user an immediate feedback that the application is loading and this seems to resolve the issue. Anyone wishing to have this wrapper application, please contact me offline (altmany at gmail dot com).Yair Altman
Bruno, thank you! It sounds like that might be the problem. I have no clue about what i should do but i will study on it. I actually hope to get a result..One more thing that i forgot to mention; the code i gave above creates a java frame and when i compile it, it doesnt work like a figure window. After appearing on screen it suddenly disappears and my application terminates (i also checked from task manager). I know that using a Matlab figure instead of a java frame is a solution but is it possible to use a java frame with a reasonable way? (using a pause shouldnt be one for example..)
---------------------------------------------------------------------
How are you launching it? Are you double-clicking on the icon in
Windows Explorer (My Computer)? Yes if it bombs it will barf a bunch
of stuff to the console window and then immediately close down the
console window. You need to run it from the command line or MATLAB in
order to have all the stuff it barfed up remain for you to inspect.
Here, try this:Take these lines and save them to a file and call the file
RunDOSPromptHere.reg:REGEDIT4[HKEY_CLASSES_ROOT\Directory\Shell\DosPrompt]
@="Run MS-DOS Prompt here"
[HKEY_CLASSES_ROOT\Directory\Shell\DosPrompt\Command]
@="Cmd /k CD \"%L\" "Now double click that file and say yes when it asks you for permission
to change the registry. What this will do is give you a new context
menu when you right click on a folder in Windows Explorer. You can
browse to any folder (such as the one where your exe lives) and then
right click and select "Run MS-DOC Prompt here" from the pop-up
context menu. It will immediately give you a console window with that
folder as the current directory. Basically it's the same as doing
Start/Run/cmd and then typing cd "c:\whatever\blahblahblah\yadayada"
Now, once you're in that folder, type the name of your executable and
it will run. BUT when it barfs and exits, all the stuff you printed
out plus all the error messages will remain in the console window for
you to inspect. You can do this on your target computer.Have you verified that the executable works on your development
machine? You can do that by cd'ing to the folder where you told it to
put the exe. Then, in the MATLAB command window type ! (exclamation
mark) followed immediately (no space) with the name of your
executable. If it crashes also on your computer then that gives you
something to track down easier than deploying and trying to debug on
the target computer. The crash info will appear, and remain, in the
MATLAB command window.Finally since you paid $5000 for the compiler, the Mathworks is pretty
helpful in helping you. I've had them track down some pretty esoteric
issues with compiled programs before. So if the entries in the FAQ
have all been tried and all failed, give the Mathworks tech support a
try - might as well get some support for your $5k.
Good luck,
ImageAnalyst
I didnt even try the waitfor because i had assumed that it needed a valid matlab handle something like javacompenent gives. It turns out that java components are also used with waitfor. But i am not sure exactly what 'waitfor' actually waits for; because when i close the java frame it still waits :)
Then i tried something else, i changed the closing callback as follows;
frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
Guess what, when i close the frame now it also closes Matlab :) But surprisingly it worked for standalone. Program is terminated only when i close the window. I think using with 'isdeployed' might be a solution..
@Bruno, nothing changed unfortunately.
I have compiled my application with -C option and ctf files were extracted at the same folder with my executable file. However it still waits a very long time when the first time executed after restarting the computer. Everything is same with the case that ctf is embedded in exe file except some weird files in ctf folder. What is wrong here?
I don't know, it might be many reasons: your exe load some DLL, some anti-virus kicks in, etc. Contact TMW customer support if you think it's abnormal and the issue is not related to how your computer is setup.Bruno
Hi YairI am very interested to get a copy of your small wrapper application. I have a large GUI that takes some time to start up especially first time when the MCR also need to be started. Therefore it could be very nice to get a copy of your small wrapper application that when I click the exe file it first run the small wrapper application and next the matlab code. When it then open the GUI window it exit the small wrapper application. Best RegardsRobin