Hello, i try to execute a .m file using PHP
i wanted to count the number of jpg files in the directory but PHP was unable to detect it.
the PHP script:
<?php
execute('start /b matlab -nosplash -nodesktop -r readfilename');
?>
where readfilename is the name of the m file (readfilename.m )
the m file:
files=dir('*.jp g');
for i=1:numel(files )
a = files(i).name;
dlmwrite('names .txt', a, 'delimiter','', 'newline', 'pc', '-append');
end
when the matlab command window pops out, i type in numel(files) and it returns a value 0 instead of the number of image files in the directory.
how do i go about solving this problem?
please advise..
thanks.
i wanted to count the number of jpg files in the directory but PHP was unable to detect it.
the PHP script:
<?php
execute('start /b matlab -nosplash -nodesktop -r readfilename');
?>
where readfilename is the name of the m file (readfilename.m )
the m file:
files=dir('*.jp g');
for i=1:numel(files )
a = files(i).name;
dlmwrite('names .txt', a, 'delimiter','', 'newline', 'pc', '-append');
end
when the matlab command window pops out, i type in numel(files) and it returns a value 0 instead of the number of image files in the directory.
how do i go about solving this problem?
please advise..
thanks.