1

I have a matlab function. I have called this function from my php code and wants to receive return value of matlab function into a php variable. Please help me out. matlab :

function img =TigerPrinting(udir, pdir, template)
% clc;
% clear all;
imdir = udir;
imdir=strcat(imdir,'\');
b=template;
% disp(b)
temp=imread([imdir,b]);
% disp(temp)
  pd=pdir;
  % disp(pd)
  img = '';
  p=strcat(pd,'\*.jpg');
  pd=strcat(pd,'\');
  %disp(pd)
  listing=dir(p);
  x=size(listing);
  x=x(1);
   % disp(x)
  for i=1:x
      a=imread([pd,listing(i).name]);
     % disp(a)
      d=TempMatch(a,temp);
     % disp(d)
      if d>0
         % disp(strcat('* ',b,' found in image  ',listing(i).name));
          img = strcat(img,',',listing(i).name);
      else
          % disp(strcat('* ',b,' not found in image  ',listing(i).name));
      end
  end
 display(img);
 %quit force
 end

this function working properly and img contains desire value

php code :

$command = "matlab  -wait -nojvm -nodesktop -nodisplay -r \"  TigerPrinting('".$l_udir."','".$l_pdir."','".$left_flank ."');\" ";

        $ot = exec($command);
        echo($ot);

but $ot echos nothing.

0 Answers0