Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titlekvadratrot.m
Code Block
titlekvadratrot.m
function retur = kvadratrot(tall)
    x = 1;
    er_over_feilgrense = true;
    i = 1;
    while er_over_feilgrense
       ny_x = x + (tall - x^2)/(2*x);
       fprintf('Iterasjon #%d: x_%d = %.10f, x_%d = %.10f\n', i, i-1, x, i, ny_x);
       relativ_endring = abs(ny_x - x)/x;
       er_over_feilgrense = relativ_endring >= 1e-9;
       x = ny_x;
       i = i + 1;
    end
    retur = x;
end 

Videoforklaring (15:46)

Del 1 (4:00)Del 2 (9:12)Del 3 (2:34)
Widget Connector
urlhttps://www.youtube.com/watch?v=1VBnsEaz-lg
Widget Connector
urlhttps://www.youtube.com/watch?v=lC3Jy8uVECM
Widget Connector
urlhttps://www.youtube.com/watch?v=IE42ZNiVcMc

...