首页 > 解决方案 > octave 支持本地函数吗?

问题描述

我是否更正了 Octave(4.4.0)中不可能的“本地函数”( https://de.mathworks.com/help/matlab/matlab_prog/local-functions-in-scripts.html#bvfvxg0 ),例如:

data = 1:10;            %# A vector of data
squaredData = f(data);  %# Invoke the local function

function y = f(x)
  y = x.^2;
end

我得到错误

error: 'f' undefined near line 2 column 15

标签: octave

解决方案


推荐阅读