Newton method MATLAB 实现
摘要:
%求解目标函数:f(x) = cos(x) - x^3%x0 is initial value%err: stop condition%output root: the root of the functionfunction root = NewtonMethod(x0,err)f_x0 = cos(x0) - x0^3;%f(x0)的函数值f_x0_diff = -sin(x0)-3*x0^2;%f(x0)的导数x1 = x0 - f_x0/f_x0_diff;delta = abs(x1 - x0);while delta > err x0 = x1; f_x0 = cos(x0) 阅读全文
posted @ 2011-12-03 18:49 Alex Yu 阅读(2201) 评论(0) 推荐(0) 编辑