我在M-file下编写了一下程序 f.m function f=f(x,y); f=-y+x+1; 然后保存在work目录下 但是我调用时 我打[x,y]=euler('f',0,1,1) 他显示错误如下 Warning: EULER is obsolete and will be eliminated in future versions. Use SIM instead. > In E:\matlab\toolbox\simulink\simulink\euler.m at line 15 Warning: Unable to open model file 'f.mdl'. > In E:\matlab\toolbox\simulink\simulink\euler.m at line 63 ??? Error using ==> sim Unable to load block diagram 'f'. Error in ==> E:\matlab\toolbox\simulink\simulink\euler.m On line 63 ==> [t_cp2wksp,x_cp2wksp,y_cp2wksp] = sim(sys, time, simOptions, ut, varargin{:}); 还有我编写了fc.m function y=fc(x) y(1)=x(1)-0.7*sin(x(1))-0.2*cos(x(2)); y(2)=x(2)-0.7*cos(x(1))+0.2*sin(x(2)); y=[y(1) y(2)];保存在work下 然后输入x0=[0.5 0.5]; >> fsolve('fc',x0) 他显示错误如下Warning: Cannot determine from calling sequence whether to use new (2.0 or later) FSOLVE function or grandfathered FSOLVE function. Assuming new syntax; if call was grandfathered FSOLVE syntax, this may give unexpected results. To force new syntax and avoid warning, add options structure argument: x = fsolve(@sin,3,optimset('fsolve')); To force grandfathered syntax and avoid warning, add options array argument: x = fsolve(@sin,3,foptions); > In E:\matlab\toolbox\optim\fsolve.m (parse_call) at line 390 In E:\matlab\toolbox\optim\fsolve.m at line 102 ??? Error: File: E:\matlab\work\fc.m Line: 2 Column: 1 A function declaration cannot appear within a script M-file. Error in ==> E:\matlab\toolbox\optim\fsolve.m On line 162 ==> fuser = feval(funfcn{3},x,varargin{:}); 这是什么意思请帮忙!!!谢谢大家