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
請輸入代碼