如何使用Php在Matlab上显示图像 [英] How Do I Display Image On Matlab Using Php

查看:83
本文介绍了如何使用Php在Matlab上显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的PHP代码。

 <?php  
if(isset) ($ _POST [' filepath'])){
$ filename = $ _POST [' filepath'];
$ inputDir = 其中位于matlab文件(C:\ wamp \\\ pay);
$ command = matlab -sd 。$ inputDir。 -nodisplay -nosplash -nodesktop -r myFunc('。 $ filename。 ');
$ output = exec($ command);
}
?>





和Matlab函数。

 function [] = myFunc(filename)
a = imread(filename);
image(a);
结束



当我在Windows中使用命令提示符运行此matlab函数时,使用以下命令将显示图像。

  matlab -sd C:\ wamp \ -www -\\pay -nodisplay -nosplash -nodesktop -r myFunc('C:\ wamp \\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\显示图像。任何人都可以帮助我吗?

解决方案

_POST [' filepath'])){


filename =


< blockquote> _POST [' filepath'];


This is my PHP code.

<?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?

解决方案

_POST['filepath'])) {


filename =


_POST['filepath'];


这篇关于如何使用Php在Matlab上显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆