Question: It's a matlab question Function Name: stockExchange Inputs 1. (double) A 2xN array of data from the New York Stock Exchange Outputs 1. (double) A
It's a matlab question

Function Name: stockExchange Inputs 1. (double) A 2xN array of data from the New York Stock Exchange Outputs 1. (double) A 2xN array of updated data Background Due to years of poor record keeping, the New York Stock Exchange is missing valuable historical information about the prices of stocks and needs your help! The previous record keeper missed work often, and for each day of absence a stock price is missing in the NYSE's data. Impressed with your MATLAB knowledge, the Head of Data Management and Analytics hires you to avert the impending data crisis Function Description: You are given an array containing two rows, the first corresponding to a day of the month and the second corresponding to the price of a particular stock on that day. On a day when the record keeper was absent, there will be an NaN in the index of the stock price for that day. Your function should replace each NaN with the correct stock price, which you will determine by spline interpolation Example >> arrL 4 6 8 200.10 203.20 NaN 197.41 201.30 200.00 NaN 206.4] out stockExchange (arr) out[1 4. 6 200.10 203.20 199.34 197.41 201.30 200.00 198.35 206.4] Notes . Do not use iteration to solve this problem . If an NaN occurs in the first or last index, you should extrapolate the data to find the correct stock price . All computed stock prices should be rounded to the nearest penny . Use of the spline function with inputs that contain NaN is not required to solve this problem. If you choose to solve it this way you can ignore the warning produced Hints . What happens when you call isnan) with a vector input? Function Name: stockExchange Inputs 1. (double) A 2xN array of data from the New York Stock Exchange Outputs 1. (double) A 2xN array of updated data Background Due to years of poor record keeping, the New York Stock Exchange is missing valuable historical information about the prices of stocks and needs your help! The previous record keeper missed work often, and for each day of absence a stock price is missing in the NYSE's data. Impressed with your MATLAB knowledge, the Head of Data Management and Analytics hires you to avert the impending data crisis Function Description: You are given an array containing two rows, the first corresponding to a day of the month and the second corresponding to the price of a particular stock on that day. On a day when the record keeper was absent, there will be an NaN in the index of the stock price for that day. Your function should replace each NaN with the correct stock price, which you will determine by spline interpolation Example >> arrL 4 6 8 200.10 203.20 NaN 197.41 201.30 200.00 NaN 206.4] out stockExchange (arr) out[1 4. 6 200.10 203.20 199.34 197.41 201.30 200.00 198.35 206.4] Notes . Do not use iteration to solve this problem . If an NaN occurs in the first or last index, you should extrapolate the data to find the correct stock price . All computed stock prices should be rounded to the nearest penny . Use of the spline function with inputs that contain NaN is not required to solve this problem. If you choose to solve it this way you can ignore the warning produced Hints . What happens when you call isnan) with a vector input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
