Question: MATLAB PROBLEM - [PLEASE DO NOT WRITE ON PAPER] Assignment 5: User Defined Functions I he tollowing equation illustrates how to calculate an output tor
MATLAB PROBLEM - [PLEASE DO NOT WRITE ON PAPER]
Assignment 5: User Defined Functions
![MATLAB PROBLEM - [PLEASE DO NOT WRITE ON PAPER] Assignment 5: User](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f312592554e_97666f31258a4bbd.jpg)
I he tollowing equation illustrates how to calculate an output tor any input, using linear interpolation. The input must be within the bounds of the data set. The constants come from the data set; they are the nearest data points that bound the original input Constants from Data Set 2- Output Input Problem Create a function file that calculates the linearly interpolated y-value (output) provided an x-value (input). The function should linearly interpolate to find y given any x using the air velocity and thermal resistance data below 1) This problem could be solved using array operations; but, for practice you are required to use a for- loop: Use a for loop inside this function file that loops through the rows of the data to determines which two rows of the data an input falls between. The row that is the lower bound will become the x1 and yivalues; the row that is the upper bound will become x2 and y2. Calculate y given x, x1, y, x2, and y2 Test the code by calling this user-defined function inside the for loop of a script for values from 0 to 1700 (air velocity) and plotting the results 2) 3) Thermal Air Velocity Resistance 200 200 400 600 800 1000 1200 1400 1600 1800 373.0 156.1 113.6 93.1 81.5 73.7 67.2 62.4 58.3 55.0 E 150 Interpolated value Tabulated values C100 50 Example: x- 480 X1 400 (Lower Bound) x2-600 (Upper Bound) y1-113.6, y2-93.1 500 1000 1500 2000 Air Velocity [FPM] (93.1- 113.6) y = 113.6 + (480-400) * Resulting value of y: 105.4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
