Expert... help me on this problem, i already try many times during this 2 week, but i cant the answer by using m-files.
Determine the real root of f(x)=-26+85x-91x^2+44x^3-8x^4+x^5
Using bisection to determine the root to εs=10 %. Employ initial guesses of xl=0.5 and xu=1.0.
You need to solve the above problem using Matlab
1
Expert's answer
2012-04-05T09:21:38-0400
function [c,err,yc]=bisection(f,a,b,err_tolerance) ya=feval(f,a); yb=feval(f,b); if ya*yb > 0,return,end maxx=1+round((log(b-a)-log(err_tolerance))/log(2)); for k=1:maxx c=(a+b)/2; yc=feval(f,c); if yc==0 a=c; b=c; elseif yb*yc>0 b=c; yb=yc; else a=c; ya=yc; end if b-a < err_tolerance, break,end end c=(a+b)/2; err=abs(b-a); yc=feval(f,c);
but y it appear those error comment? ??? Error: File: Untitled.m Line:
6 Column: 1 Function definitions are not permitted in this context....
tis error come out by the "function" word...
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
but y it appear those error comment? ??? Error: File: Untitled.m Line: 6 Column: 1 Function definitions are not permitted in this context.... tis error come out by the "function" word...