由买买提看人间百态

topics

全部话题 - 话题: loopind
(共0页)
l*******G
发帖数: 1191
1
来自主题: Computation版 - strange matlab slowing-down problem
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
来自主题: Computation版 - strange matlab slowing-down problem
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
来自主题: Computation版 - strange matlab slowing-down problem
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
来自主题: Computation版 - strange matlab slowing-down problem
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 ... 阅读全帖
(共0页)