Please solve the following equation using MATLAB please show all steps , i\'m ha
ID: 2291618 • Letter: P
Question
Please solve the following equation using MATLAB please show all steps , i'm having a hard time undersanding it.(Please Paste the codes bellow ) ,I have to take my final exam in the next 48 hours.
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
Find below the MATLAB code. Change the value of A to 81,49,16,3 etc to whichever is required.
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);