Question: Help with Matlab code required. = Create the vector robs = [-5, -4, ... , 4, 5). Create the vector Yobs = (sin(-5), sin(-4), ...
Help with Matlab code required.
= Create the vector robs = [-5, -4, ... , 4, 5). Create the vector Yobs = (sin(-5), sin(-4), ... , sin(4), sin(5)]. Create the vector lint [-5, -4.99, ... , 4.99,5). Basically, we know the value of the function y over a coarse grid Xobs, but we would like to know the value of the function over a much denser grid, l'int. This operation is called interpolation. Get Yint, which is the value of function corresponding to lint obtained through interpolation, using 'interpl' command. Use three different interpo- lation methods: linear, pchip (which is cubic), and nearest. Also get ytrue, which is the true value of function corresponding to lint. Plot ytrue as well as Yint obtained from the three methods over Yint in one figure. Insert a legend so that we can see which curve is which. Which method performs the best? = Create the vector robs = [-5, -4, ... , 4, 5). Create the vector Yobs = (sin(-5), sin(-4), ... , sin(4), sin(5)]. Create the vector lint [-5, -4.99, ... , 4.99,5). Basically, we know the value of the function y over a coarse grid Xobs, but we would like to know the value of the function over a much denser grid, l'int. This operation is called interpolation. Get Yint, which is the value of function corresponding to lint obtained through interpolation, using 'interpl' command. Use three different interpo- lation methods: linear, pchip (which is cubic), and nearest. Also get ytrue, which is the true value of function corresponding to lint. Plot ytrue as well as Yint obtained from the three methods over Yint in one figure. Insert a legend so that we can see which curve is which. Which method performs the best
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
