服务器上跑matlab程序

来源:互联网 发布:linux查看80端口被占用 编辑:程序博客网 时间:2024/05/17 21:07

怎么在服务器上跑matlab程序呢?

一种新的方式 运用ssh命令

ssh -l usename  192.168.... 然后再输入password 就可以在terminal中直接打开远程服务器了。

另一种old方式如下:

1 windows界面下使用putty,输入服务器ip地址,然后用户名和密码

2 将自己的代码上传到服务器上

3 使用这个命令来使用 matlab -nodesktop

看这个网址http://www.sc.fsu.edu/computing/tech-docs/325-matlab

(

With the exception of the classroom and hallway computers, MATLAB access is available only on the General Purpose (GP) Cluster through SGE. Unless initiated through an X11-capable terminal (i.e. Gnome Terminal, xterm, rxvt, etc.), MATLAB will start in a text-only command-line mode.

NOTE: To force MATLAB to run in command-line mode use the following flags:

matlab -nodesktop -nojvm -nosplash
 -nodesktop Start MATLAB without its desktop. -nojvm Start MATLAB without the Java virtual machine (JVM). -nosplash Start MATLAB but does not display the splash screen.
)

今天下午搞了1个小时的matlab程序

发现如下情况:

1  服务器上没有matlab的GUI,因此类似imshow函数不能用。

2  matlab代码中居然不能加入根目录!!!(后来和ywang讨论才想起 linux下是/ 而windows下是\, 目录表示路径不一样啊,坑爹呢

3 里面uint8和double区分的很明确!

所以只能将图像保存下来

imwrite的用法

imwrite(A,filename,fmt)。

如:imwrite(uint8(regionColor),'depth11111.jpg','jpg');

在windows平台下,还可以使用winscp来向linux服务器进行界面操作传输文件!传输完文件之后还是得利用putty来跑matlab程序。

如果我们想在windows下调用linux服务器matlab的界面,那么我们得按照xmanager,这个软件来远程控制服务器端的桌面。如果是你的pc是linux的话那么

直接运行matlab就出来gui界面了,如果你想后台运行,那么加上前面的那个命令

-nodesktop

还有一个问题就是中文乱码的情况, putty在windows使用下中文乱码问题解决方案http://blog.csdn.net/hjy273/article/details/4102714