matlab二分法,单点弦截法,牛顿切线迭代法
二分法%p222task2_3%二分法求f=@(x)1-x-sin(x)零点clc,clear;f=@(x)1-x-sin(x)b=1;a=0;f(0)f(1)ezplot(f,[0,1])hold onezplot(@(x)0,[0,1])while b-a>0.0001 m=(a+b)/2; if f(m)==0 break; end