我使用以下代码示例从Matlab调用perl函数:
tst = perl('Function.pl','arg1', 'arg2', 'arg3')
但是Function.pl在第一行使用命令"要求' OtherFuction.pl'"在函数体中调用。当需要"时,Matlab会出现错误。在代码中。当我删除代码时,它可以工作,但是当" OtherFunction"被称为,提出了与此有关的错误。 我的问题是:我可以使用"要求"在一个由Matlab调用的perl函数中?
编辑:Conform建议,出现的错误是:"使用perl时出错(第80行) 系统错误:执行命令:perl hello.pl"。提到的代码(第80行 - perl.m)是:
% Check for errors in shell command
if nargout < 2 && status~=0
error(message('MATLAB:perl:ExecutionError', result, cmdString));
end
似乎是一般错误,Function.pl中的init代码是:
require 'OtherFunction.pl';
my $strLutTable = $ARGV[0];
my $strLutRow = $ARGV[1];
my $strLutCol = $ARGV[2];
continues...
注意&#34;要求&#34;被删除,错误不会发生,但无法调用函数&#34; OtherFunction.pl&#34;,所以不能解决我的问题。有一个表格可供使用:
Function.pl-><Call>->Function1.pl-><Call>->Function2.pl-><Call>->...->FunctionN.pl
考虑到从Matlab代码调用perl。
谢谢!