BUT2/Math/scilab_tp2.txt

20 lines
321 B
Plaintext
Raw Permalink Normal View History

2023-10-12 16:39:49 +02:00
function [x_out] = Heron(x0, n)
xn = x0;
for i = 1:n
xn = xn - (xn*xn-2) / 2*xn;
end
x_out = xn;
end
--------------------------------------------------
function [x_out] = Heron(x0, n)
y=
xn = x0;
for i = 1:n
xn = xn - (xn*xn-2) / 2*xn;
end
x_out = xn;
end