Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ONE QUICK QUESTION USING MATLAB *************************************************************************************************** Write a MATLAB function that accepts as input a set of {x_i, y_i} data and a desired x value,
ONE QUICK QUESTION USING MATLAB
***************************************************************************************************
Write a MATLAB function that accepts as input a set of {x_i, y_i} data and a desired x value, and returns the corresponding y value by performing linear interpolation. Your function should be able to be used with the following format: yinterpolated = yourfunctionname (x, y, xgoal); x is a vector of x values, y is a vector of y values, and the function should return the value y(xgoal). You may make the following assumptions about the inputs to the function. The inputs x and y are vectors of the same length. The length of x and y is at least 2. The x values are already sorted from smallest to largest values. xgoal is a scalar (single valued) number, and it falls between the smallest and largest values of the values in the vector x. Your function should NOT display anything to the screen. Please write your function as a separate M-file and upload it separately with the rest of the homework assignment
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started