Question: 1. Consider the following Matlab function function [r1 r2] = ratio(x1 , x2,n) r1 = zeros (n, 1,' single'); r2- r1; for k 1:n rl
![1. Consider the following Matlab function function [r1 r2] = ratio(x1](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66dccedb0af96_90666dcceda780ce.jpg)
1. Consider the following Matlab function function [r1 r2] = ratio(x1 , x2,n) r1 = zeros (n, 1,' single'); r2- r1; for k 1:n rl (k) r2(k) x1"(21)%2^ (2^k); (x1/x2) ^ (2%); end and run it with the following matlab script function as driver: x1 -single (10); x2 single (30); n - 7; [r1 r2] - ratio(x1,x2,n); [rl r2] Clearly the function computes, in single precision, the ratio s-(a) C1 in two different ways for k -1: 7. (a) Describe how a single precision floating point number is stored in IEEE arithmetic as well as what limits are imposed on th
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
