用户可以自定义函数, octave 函数通过值传递并能返回多个返回值,按如下格式定义函数: function[输出1, 输出2, ...] = name(输入1, 输入2, ...) % code end 1. 2. 3. 例如我们可以定义计算 sin 的函数 function s=sind(x) % SIND(x) Calculates sine(x) in degrees s=sin(x*pi/180); end 1....
Oct2Py allows you to seamlessly call M-files and Octave functions from Python. It manages the Octave session for you, sharing data behind the scenes using MAT files. Usage is as simple as: >>> import oct2py >>> oc = oct2py.Oct2Py() >>> x = oc.zeros(3, 3) >>> print(x, ...