hw_04_1_13c
raw download clone
MATLAB
views 11
,
size 275 b
clear;
clc;
format long;
f = @(x) (230 * x^4) + (18 * x^3) + (9 * x^2) - (221 * x) - 9;
df = @(x) (920 * x^3) + (54 * x^2) + (18 * x) - 221;
x0 = -1/2;
%x0 = 1/2;
Err = 1;
while Err > 10^(-6)
  x = x0 - (f(x0) / df(x0));
  Err = abs(x - x0);
  x0 = x;
endwhile
x
close fullscreen
Login or Register to edit or fork this paste. It's free.