MATLAB gets stuck in the "Initializing" state during startup from bat file

I am running win7 and MATLAB 2010B. The MATLAB licence is held on our lab licence server.
When I start MATLAB normally it runs fine. "Initializing" takes a few seconds and then proceeds to "Ready" as expected. Great.
I now ask MATLAB to start through a bat file on Task Scheduler at 3am (say). When I get into the office at 7am (yeah, sure!) I see MATLAB has fired the IDE up fine but has got stuck in the intializing state.
Hence this problem only occurs when running from bat file.
I read the below: http://www.mathworks.co.uk/support/solutions/en/data/1-2Z18MA/ I do not have any such MATLAB related system env variables specified, but I do not think this relates to a MATLAB licence held on a server.
I put pause(120) at the start of my matlab file, but it makes no diffference.
I then try and modify my bat file from:
start matlab -r "addpath('D:\CODE\MATLAB\Matlab_Code\startUp');abs_autoStartUp"
to
start matlab -c 28000@999.999.999.6 -r "addpath('D:\CODE\MATLAB\Matlab_Code\startUp');abs_autoStartUp"
Where the port and the ip address are the ones specified in network.lic in my program files. The path relates to the location of abs_autoStartUp.m.
This seems to make no difference.
This is running on a stand alone machine, not connected to a domain.
(apologies, as this is a "repost" as it was accidentially accepted as being correct the first time round).
any ideas?
thanks!!

1 Comment

Cross-reference: http://www.mathworks.com/matlabcentral/answers/37741-matlab-gets-stuck-in-the-initializing-state-during-startup-from-bat-file

Sign in to comment.

 Accepted Answer

just spoke to matlab about this.
When calling matlab from the command line and going straight into a function, matlab will stay in the intializing state as it takes the function being called as part of the intialization.
Their opinion is that this shouldn't effect anything else.

1 Comment

Good to know. When asked a reasonable question, the technical support from TMW is generally very good.

Sign in to comment.

More Answers (2)

More questions than answers, but I will throw them out as an answer:
In the morning after the machine has been rebooted from the Task Scheduler can you launch MATLAB?
Does the license server get powered down at 3am?
What about if your bat file "sleeps" for a couple of minutes after rebooting so the network can come up?
Can you contact the license server from the bat file?

8 Comments

I think I have confused the issue by mentioning Task Scheduler and 3am...
This behaviour occurs when ever running from bat file.
re: "Can you contact the license server from the bat file?". What do you mean by this? Please explain in detail.
Good to know about the Task Scheduler. To clarify if you open a command window and type
matlab -r "addpath('D:\CODE\MATLAB\Matlab_Code\startUp');abs_autoStartUp"
you are good to go, but if you put the same line in a file and save it as test.bat and then type test at the prompt to run it, you get no joy?
What is the "start" doing in the command?
What does you MATLAB path look like?
when I run this command from the cmd window, I get the same behaviour as the bat file. MATLAB hangs at intializing.
what do you mean "What is the "start" doing in the command?" ?
My matlab code base is at : 'D:\CODE\MATLAB\Matlab_Code\'.
What happens if you just try and start MATLAB from a command window?
So ML starts at least. I doubt thats a license issue than. What does your abs_autoStartUp.m file do? What happens when specify no -r flag? Does MATLAb does start as it should?
When I run the following through DOS, MATLAB starts ok and proceeds THROUGH "initializing" to "READY"
start matlab "addpath('D:\CODE\MATLAB\Matlab_Code\startUp');abs_autoStartUp"
When I run the following through DOS, MATLAB does not start ok and stays at "initializing"
start matlab -r "addpath('D:\CODE\MATLAB\Matlab_Code\startUp');abs_autoStartUp"
Are you really typing "start" at the dos command prompt and then "matlab"?
my above answer is
1.open DOS
2. Copy and paste the whole line of code in.
3. hit enter.
...
4. Watch matlab start and stay in the intializing mode.

Sign in to comment.

1. open DOS
2. type
matlab -r "addpath('D:\CODE\MATLAB\Matlab_Code\startUp');abs_autoStartUp"
3. hit enter
Critical to this is not to use "start"

4 Comments

This doesnt make any difference to the observed behaviour.
without the start, it behaves in excactly the same way, inc getting stuck in the initializing state.
autoStartUp does not contain anything odd.
eg
function autoStartUp()
for i = 1: inf
disp(num2str(i));
end
end
That works fine for me. I would think about creating a new temporary user and seeing if it works for that user. If it doesn't, then contact technical support with all the details you have given here.
and you are using a licence sever?

Sign in to comment.

Categories

Tags

Community Treasure Hunt

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

Start Hunting!