function f=fun(x1,x2) f=x1^2+x2^2; end
好比计算xn=n^3+1,n从1到10函数
function xn=fun(n) for n=1:1:10 n xn =n^3+1 end end
请输入代码