Page 1 of 1

suppress nrniv black screen

Posted: Mon Jun 14, 2010 2:36 pm
by hassanf
Hi,

I'm controlling Neuron from Matlab in MSWin. I'm using Matlab to write some parameters that need to be changed in .hoc file to some .dat file. Then I open this file in Neuron using xopen command, to start doing simulation using these values, and records some variables then stores them in a file. After the simulation is finished, Matlab starts doing computation on the stored values in the file (results from Neuron). If necessary, it changes values in .dat file and opens Neuron to start simulations with new values. This process continues until proper values for certain parameters are found.

However everything works fine, but the problem is the appearance of a black command screen while doing simulation, which is a bit annoying when I'm using batch mode in Matlab. in this case it opens several instances of this black screen.

I'm using system command in Matlab to open Neuron to start doing simulation.

Code: Select all

% hoc_path is the path for "nrniv -nogui apic_model.hoc"
[foo, result] = system(hoc_path);

Re: suppress nrniv black screen

Posted: Mon Jun 14, 2010 7:36 pm
by ted
What does apic_model.hoc do after it completes execution? If you start a command line interpreter window yourself, then execute
nrniv -nogui apic_model.hoc
manually, does NEURON's interpreter window remain open, showing its oc> prompt? If yes, then try inserting
quit()
as the last command in apic_model.hoc

Re: suppress nrniv black screen

Posted: Wed Jun 16, 2010 10:55 am
by hassanf
Thank you for the reply.

without quit() command, Matlab waits for ever, so apic_model.hoc must have the "quit()" command as its last line of code. and after each simulation it quits without any problem but the black-cmd screen of nrniv.exe stay while the simulation is running. however, without quit() command, Matlab waits for ever.

I tried to run it from windows command, by running: "nrniv -nogui apic_model.hoc" but the black-cmd screen pops up again and stay until the end of simulation.

Note: I found that this black-cmd screen doesn't appear in linux, when using exclamation mark "!" to run neuron from Matlab.

Re: suppress nrniv black screen

Posted: Wed Jun 16, 2010 11:57 am
by ted
Can you get Matlab to pass MSWin a command like this?
c:\nrnxx\bin\nrniv.exe -nogui /cygdrive/c/path
where you replace nrnxx with the name of the directory where NEURON is installed
and path is the path from the root of c to wherever your hoc file is located.

For example, on my machine, which is running version 7.2, given this hoc file
c:\home\myhoc\foo.hoc
the command would be
c:\nrnxx\bin\nrniv.exe -nogui /cygdrive/c/home/myhoc/foo.hoc

Re: suppress nrniv black screen

Posted: Thu Jun 17, 2010 5:37 am
by hassanf
I used the command that you suggested, but same black screen(s) appear again.

This morning, I tried to run my M.file in matlab-command line: "matlab -nojvm -noFigureWindows -r apic.m" but i got the same result.

Re: suppress nrniv black screen

Posted: Sat Jun 19, 2010 11:17 am
by hines
When I create

Code: Select all

bash-3.2$ pwd
/cygdrive/c
bash-3.2$ cat temp.hoc
print "hello"
quit()

bash-3.2$ 
and start malab on my xp laptop I see

Code: Select all

>> system('c:/nrn72/bin/nrniv /cygdrive/c/temp.hoc')
NEURON -- VERSION 7.2 (445:d8e244719b0d) 2010-06-10
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

hello

ans =

     0

>> 
and do not expeience the empty black terminal window.
The above version comes from
http://www.neuron.yale.edu/ftp/neuron/versions/alpha/

My matlab is 7.10.0 (R2010a)

By the way, it is possible to get matlab and NEURON intimately communicating via python
using mlabwrap.