Question: Matlab Coding 3 Look-up Table In this problem, you will implement a binary search with bilinear interpolation to estimate the value of the function f

Matlab Coding 3 Look-up Table In this problem, you will implement aMatlab Coding

3 Look-up Table

In this problem, you will implement a binary search with bilinear interpolation to estimate the value of the function f (x, y) = sin(x) cos(y) for any pair (x, y).

Write a recursive function called bsearch with header: function y = bsearch(x, key, left, right)

where x is a sorted double array, key is the number we need to search for, and left and right are the indices of the search range. The output y = [y1 y2] is an array of two indices, such that key lies in (x(y1), x(y2)). Again, you may use the code provided in class as a starter.

Create a two-dimensional array called table which contains the values of f (x, y) for x and y taking values between 0 and 360 (in degrees) with increment of one. Hence, the table should have dimension 361 361.

Write a function called tableLookup with header: function val = tableLookup(table, x, y)

where x and y are real numbers between 0 and 360, and val is the estimated value of the function f for arguments x and y using bilinear interpolation.

Write a function called findmaxError with header: function val = findmaxError(table, xc, yc)

This function will compare the approximate values of f for the points whose (x,y)-coordinates are defined by the arrays xc and yc to the corresponding exact values. It will output in var the absolute value of the maximum error over all these points.

ENGINEERING 7 3 Look-up Table In this problem, you will implement a binary search with bilinear interpolation to FALL 2018 estimate the value of the function f(x, y)- sin(x) cos(y) for any pair (x, y) 1. Write a recursive function called bsearch with header: function y = bsearch(x, key, left, right) where x is a sorted double array, key is the number we need to search for, and left and right are the indices of the search range. The output y = [y1 y2] is an array of two indices, such that key lies in (x(y1), x(y2)). Again, you may use the code provided in class as a starter. 2. Create a two-dimensional array called table which contains the values of f(x, y) for x and y taking values between 0 and 360 (in degrees) with increment of one. Hence, the table should have dimension 361 361. 3. Write a function called tableLookup with header function val - tableLookup (table, x, y) where x and y are real numbers between 0 and 360, and val is the estimated value of the function f for arguments x and y using bilinear interpolation. . Write a function called findmaxError with header: function val findmaxError(table, xc, yc) This function will compare the approximate values of f for the points whose (x, y)-coordinates are defined by the arrays xc and yc to the corresponding exact values. It will output in var the absolute value of the maximum error over all these points. ENGINEERING 7 3 Look-up Table In this problem, you will implement a binary search with bilinear interpolation to FALL 2018 estimate the value of the function f(x, y)- sin(x) cos(y) for any pair (x, y) 1. Write a recursive function called bsearch with header: function y = bsearch(x, key, left, right) where x is a sorted double array, key is the number we need to search for, and left and right are the indices of the search range. The output y = [y1 y2] is an array of two indices, such that key lies in (x(y1), x(y2)). Again, you may use the code provided in class as a starter. 2. Create a two-dimensional array called table which contains the values of f(x, y) for x and y taking values between 0 and 360 (in degrees) with increment of one. Hence, the table should have dimension 361 361. 3. Write a function called tableLookup with header function val - tableLookup (table, x, y) where x and y are real numbers between 0 and 360, and val is the estimated value of the function f for arguments x and y using bilinear interpolation. . Write a function called findmaxError with header: function val findmaxError(table, xc, yc) This function will compare the approximate values of f for the points whose (x, y)-coordinates are defined by the arrays xc and yc to the corresponding exact values. It will output in var the absolute value of the maximum error over all these points

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!