我正在尝试使用Octave,我找不到如何运行一些使用文件功能的脚本,我尝试的最后一件事是创建一个类,但没有成功.问题是某些功能在其他功能中.例如:
classdef ALLFUNCS
methods(Static)
function result = SumElements(a,b,c)
result = a + b + c;
end
function [prod,div] = MultiplyDivide(v1,v2,v3)
prod = v1 * v2 * v3;
div = v1 / v2 / v3;
end
function resulta = powelents(a,b,c)
pas = SumElements(a,b,c);
resulta = pas*pas;
end
end
end
Run Code Online (Sandbox Code Playgroud)
在我放的命令行中
s2 = ALLFUNCS.powelents(3,4,5);
Run Code Online (Sandbox Code Playgroud)
错误是:
error: 'SumElements' undefined near line 11 column 19
error: called from
powelents at line 11 column 17
Run Code Online (Sandbox Code Playgroud)
那么我该如何解决这个问题呢?