![]() 2-5.C xx=linspace(0,1) yy=fun (xx) fprintf('for the function f(x)=') disp(fun) figure(2) plot (xx,yY) xlabel('x') ylabel('f(x)') title('x vs. f(x) plot') (root)=bisection_method(fun, 0,1,1000) fprintf('\tRoot using Bisection method is $f.\n',root) hold on plot (root, fun(root), 'r*') grid on box on $table for x and fl(x) fprintf('\n\t x\t\t\tf(x)\n') xx=-5:1:5 for i=1:length(xx) rr=root xx(i)*10^-10 fprintf('\t%f (8d*10^-10 )= te\n',root, xx(i), fun(rr)) end function for which root have to find fun= (x) 3. 2-5.C xx=linspace(0,1) yy=fun (xx) fprintf('for the function f(x)=') disp(fun) figure (1) plot (xx, YY) xlabel('x') ylabel('f(x)') title('x vs. ![]() %
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |