Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please solve the following equation using MATLAB , i\'m having a hard time under

ID: 3708330 • Letter: P

Question


Please solve the following equation using MATLAB , i'm having a hard time undersanding it.(Please Paste the codes bellow all steps)

Problem 2 Consider the causal non-linear discrete-time system characterized by the following difference equation: If we use as input x[n] to this system (algorithm) a step function of amplitude A (i.e. x[n]-A u[n]), then y[n] will converge after several iterations to the square root of A Write a MATLAB program that implements the above recursion to compute the square root of 8 49, 16 and 3. How many iterations does it take to converge to the true value starting at y-1]-0.2?

Explanation / Answer

y0 = 0.2; %Value of y[-1]
A=49; % Value of whose square root needs to be computed
n=0;
while abs(sqrt(x)-y0) > 0 %checking whether convergence has reached
y1=(y0 + x/y0)/2;
y0=y1;   
n=n+1; %incrementing the iteration number
end
X = ['number of iterations to converge = ',num2str(n)];
disp(X);
Y = ['Square root of ',num2str(x),' = ',num2str(y0)];
disp(Y);