l*******G 发帖数: 1191 | 1 I run matlab in linux with a batch like this:
===matlab_batch.sh===============
#!/bin/bash
#this is my bash program to run matlab code matlab_program.m
#repeatedly without GUI
loopindices="1 2 3 4 5"
for loopind in $loopindices
do
echo running matlab $loopind
matlab -nodesktop <
matlab_program
$loopind
EOF1
echo finished running matlab $loopind
done
==================
where matlab_program is another matlab code (matlab_program.m) which can run
in matlab command line prompt and it takes an ... 阅读全帖 |
|
l*******G 发帖数: 1191 | 2 I run matlab in linux with a batch like this:
===matlab_batch.sh===============
#!/bin/bash
#this is my bash program to run matlab code matlab_program.m
#repeatedly without GUI
loopindices="1 2 3 4 5"
for loopind in $loopindices
do
echo running matlab $loopind
matlab -nodesktop <
matlab_program
$loopind
EOF1
echo finished running matlab $loopind
done
==================
where matlab_program is another matlab code (matlab_program.m) which can run
in matlab command line prompt and it takes an ... 阅读全帖 |
|
l*******G 发帖数: 1191 | 3 I finally found the reason. When the directory under which I run the
code has too many (>5000) files, matlab gets very very very slow. Because in
each of the for loop iteration ($loopind), I create about 1500 temp files
to save data onto disk, and then I will load these files one by one. Before
loading them, I use calls to exist(filename,'file') to make sure the file
exists. It turns
out that exist(filename,'file') gets very very slow when there are many
files in the folder even though an e... 阅读全帖 |
|
l*******G 发帖数: 1191 | 4 I finally found the reason. When the directory under which I run the
code has too many (>5000) files, matlab gets very very very slow. Because in
each of the for loop iteration ($loopind), I create about 1500 temp files
to save data onto disk, and then I will load these files one by one. Before
loading them, I use calls to exist(filename,'file') to make sure the file
exists. It turns
out that exist(filename,'file') gets very very slow when there are many
files in the folder even though ... 阅读全帖 |
|