Question: This is for a computations class. It has to be done in matlab. Thank you 5. Write a function called smooth_data.m that will smooth noisy
5. Write a function called smooth_data.m that will smooth noisy data using a two-point average ri + 1 for all points A backwards average will be used for the smoothing such that arg except for k = 1 where rarg; =1. Use a for loop to implement this smoothing routine. Then write a script called test smooth_data.m which tests the smooth_data.m function on the data sets below. Be sure to plot the original data and the smoothed data on the same plot such as shown below. (a) Noisy data from a normal distribution with a mean of 10.0 and a standard deviation of 2.0 noisy data10.02.0 randn (100,1) b) Noisy data from sin wave with amplitude of 1 with random noise sampled from a normal distribution with a mean of 1 and a standard deviation of 0.25 tlinspace (O,10, 100) noise10.25 randn (100,1) noisy datasin(t) noise; 2.5 nolsy data 1.5 0.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
