登录论坛

查看完整版本 : 从命令行管理程序或Makefile调用Matlab / Psychtoolbox不会产生相同的行为!为什么?


poster
2019-12-14, 20:13
我以为Makefile只是执行规定的shell命令,但事情似乎并不那么简单:sample.m是一个最小的matlab程序,它在屏幕上显示一个单词。从Makefile启动时,其行为与从Shell启动时不同。

从外壳

alex:~$ matlab -nosplash -nodisplay -r "sample" ->正确显示单词

从Makefile

all : matlab -nosplash -nodisplay -r "sample" alex:~$ make ->显示带有蓝色边框的单词

有何不同?我在Ubuntu 10.04机器上使用Matlab 2010a。没有参数传递给sample.m脚本。



回答:

您确定在运行脚本后退出了Matlab吗?

Matlab控制台将在内存中徘徊,从make运行时不可见,并且某些资源将保持锁定状态。

在您的Makefile中尝试一下:

matlab -nosplash -nodisplay -r "sample; exit"

我测试了sample.m,它在这里有效。



更多&回答... (https://stackoverflow.com/questions/4924045)