简体   繁体   English

在Linux中运行Matlab脚本作为批处理作业

[英]Running Matlab script as batch job in linux

I'm trying to submit a Matlab script to a Linux server as a batch job but am not having any success so far. 我正在尝试将一个Matlab脚本作为批处理作业提交给Linux服务器,但到目前为止还没有取得任何成功。 I'm very new to Linux so not sure what I'm missing, but I've tried every permutation I can think of. 我对Linux很陌生,所以不确定我缺少什么,但我已经尝试了我能想到的每一种排列。

#!/bin/bash
#
#PBS -l walltime=1:00:00
#PBS -j oe
#PBS -o testscript.log
#
matlab -nodisplay -nojvm -nodesktop -nosplash
run testscript.m

I've also tried these lines with the same header: 我也尝试过使用相同标题的这些行:

export SCRIPT="/panfs/panasas01/phph/testscript.m"
matlab -nodisplay -nojvm -nodesktop -nosplash
$SCRIPT

And everything in between: with and without the run command, .m, quotes, filepath etc. The log file shows that Matlab opens but then can't find the command. 介于两者之间:有和没有运行命令, .m,引号,文件路径等。日志文件显示Matlab打开但无法找到命令。

I've also tried opening matlab and typing: 我也尝试打开matlab并输入:

batch('testscript')

I'm not sure if this command does what I'm looking for, but regardless it results in lots of error messages about not being able to find the variable argsin , along with 我不确定这个命令是否符合我的要求,但无论如何都会导致很多关于无法找到变量argsin的错误信息,以及

'Error using batch (line 172) Assignment has more non-singleton rhs dimensions than non-singleton subscripts' '使用批处理时出错(第172行)赋值比非单例下标有更多的非单例rhs维度'

before the first line (simply a = 10) has even executed. 在第一行(简称a = 10)之前甚至已经执行过。 The script runs with no problems otherwise. 该脚本运行没有其他问题。

Can anyone help? 有人可以帮忙吗?

Answer by @Divakar in comment box: 在评论框中回答@Divakar:

Try this - matlab -nodisplay -nojvm -nodesktop -nosplash -r testscript 试试这个 - matlab -nodisplay -nojvm -nodesktop -nosplash -r testscript

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM