Click here to Skip to main content
15,891,662 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is my PHP code.
PHP
<?php
if(isset($_POST['filepath'])) {
    $filename  = $_POST['filepath'];
    $inputDir  = "where is located matlab file (C:\wamp\www\pay)";
    $command = "matlab -sd ".$inputDir." -nodisplay -nosplash -nodesktop -r myFunc('".$filename."')";
    $output = exec($command);
}
?>


and Matlab function.
function [] = myFunc(filename)
    a = imread(filename);
    image(a);
end

when i running this this matlab function using command prompt in windows using following command the it will show the image.
matlab -sd C:\wamp\www\pay -nodisplay -nosplash -nodesktop -r myFunc('C:\wamp\www\pay\fp1.jpg')


But when i runnig it using php it doesn't show the image. Can any one help me?
Posted
Updated 11-May-15 20:05pm
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900