帮忙看看matlab二分法程序哪里出错了?报错是:Error in erfenfa (line 6)ya=f(a);Output argument "c" (and maybe others) not assigned during call to "D:\ProgramFiles\MATLAB\R2011b\bin\erfenfa.m>erfenfa".function [c,delta]=erfenfa(f,a,b,er

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/23 22:26:52
帮忙看看matlab二分法程序哪里出错了?报错是:Error in erfenfa (line 6)ya=f(a);Output argument erfenfa".function [c,delta]=erfenfa(f,a,b,er" />
xSn@Q6uǂE+,f`ah I6@+Umdd/0~$*Hws̭6j+o@߆h8h7?m+ѫ]ENw32`Q@ BPYS!5C?Su:&0f:0mkKtnX6[+n\VJ2ґEN- $o7T>|5PE*fUĊO.A&֍rKR|r0$}8w~ǻ~v,`4xetUHFS3:IY+37lu-@e! q5Rҕn Rd~ m[,ĮjF&=<šKQ+ ҈0-P-6j~R"B7ϢށJ4&bdIR%IY>?[wggŮh#!2zFɭ WFXբ׀op!

帮忙看看matlab二分法程序哪里出错了?报错是:Error in erfenfa (line 6)ya=f(a);Output argument "c" (and maybe others) not assigned during call to "D:\ProgramFiles\MATLAB\R2011b\bin\erfenfa.m>erfenfa".function [c,delta]=erfenfa(f,a,b,er
帮忙看看matlab二分法程序哪里出错了?
报错是:Error in erfenfa (line 6)
ya=f(a);
Output argument "c" (and maybe others) not assigned during call to "D:\Program
Files\MATLAB\R2011b\bin\erfenfa.m>erfenfa".
function [c,delta]=erfenfa(f,a,b,error)
%function [c,delta]=erfenfa(f,a,b,error)
%a,b是求根区间左右端点,要求a0
disp('请重新选择求根区间')
return
end
max1=1+round(log(b-a)-log(error)/log(2));
for k=1:max1
c=(a+b)/2;
yc=feval(f,c);
if yc==0
a=c;
b=c;
else
if yb*yc>0
b=c;
yb=yc;
else
a=c;
ya=yc;
end
if b-a

帮忙看看matlab二分法程序哪里出错了?报错是:Error in erfenfa (line 6)ya=f(a);Output argument "c" (and maybe others) not assigned during call to "D:\ProgramFiles\MATLAB\R2011b\bin\erfenfa.m>erfenfa".function [c,delta]=erfenfa(f,a,b,er
% f是要求根的函数,f=inline('','');
ya=f(a)
可能输入的f不能用f(a)求函数值,换成feval(f,a);试试