我更正为八度(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