PHP problem with nume1(files) in matlab

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • m31hu1
    New Member
    • Oct 2006
    • 2

    PHP problem with nume1(files) in matlab

    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.
Working...