Question

MekLelo exercise Yoot mulん Usln* to Co m

Com ma

MekLelo exercise Yoot mulん Usln* to Co m
Com ma
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB code is given below in bold letters.

clc;
close all;
clear all;

float('double');
% define the inital conditions
y0 = 20;
alpha = 620;

% implement the recursive equation using while loop
% initialize y(1)
y(1) = y0;
x = sqrt(alpha); % original value for comparison
n = 1; % counter
while(1)
  
y(n+1) = 1/2*(y(n)+alpha/y(n));
error = double(y(n+1) - x);
if abs(error) < 1e-6 % 6 digits accuracy after decimal
break;
end
n = n+1; % increment the index
end

disp('number of iterations: '),disp(n);

disp('SQRT of 620: '),disp(y(n+1));

RESULT:

number of iterations:
4

SQRT of 620:
24.8998

Add a comment
Know the answer?
Add Answer to:
MekLelo exercise Yoot mulん Usln* to Co m Com ma MekLelo exercise Yoot mulん Usln* to Co m Com ma
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT