标签:
function m
f=@(x) x^2;
y(f,3);
function y(f,x)
disp(num2str(f(x)));
end
end
函数调用另一个函数的时候,把另一个函数名作为参数变量直接传递就好。
如代码中,函数y调用函数f,把f作为参数传递进去。
http://www.ilovematlab.cn/thread-317243-1-1.html
标签:
原文地址:http://www.cnblogs.com/hxsyl/p/4640512.html