MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   从命令行管理程序或Makefile调用Matlab / Psychtoolbox不会产生相同的行为!为什么? (https://www.labfans.com/bbs/showthread.php?t=26301)

poster 2019-12-14 20:13

从命令行管理程序或Makefile调用Matlab / Psychtoolbox不会产生相同的行为!为什么?
 
我以为Makefile只是执行规定的shell命令,但事情似乎并不那么简单:sample.m是一个最小的matlab程序,它在屏幕上显示一个单词。从Makefile启动时,其行为与从Shell启动时不同。

[B]从外壳[/B]

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

[B]从Makefile[/B]

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

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



[B]回答:[/B]

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

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

在您的Makefile中尝试一下:

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

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



[url=https://stackoverflow.com/questions/4924045]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 18:08

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.