Question: In MATLAB Using Lagrange method of interpolation requires sequential calculation of differences for the coefficients of L_0, L_1, L_2 and L_3, such as t_0 =
In MATLAB
Using Lagrange method of interpolation requires sequential calculation of differences for the coefficients of L_0, L_1, L_2 and L_3, such as t_0 = 10, v(t_0) = 227.04 t_1 = 15, v(t_1) = 362.78 t_2 = 20, v(t_2) = 517.35 t_3 = 22.5, v(t_3) = 602.97 L_0(t) = Product^3_ j =0 j notequalto 0 t - t_j/t_0 - t_j = (t-t_1/t_0 - t_j) (t-t_2/t_0 - t_2) (t-t_3/t_0 - t_3); L_1(t) = Product^3_ j =0 j notequalto 1 t - t_j/t_1 - t_j = (t-t_0/t_1 - t_0) (t-t_2/t_1 - t_2) (t-t_3/t_1 - t_3); L_2(t) = Product^3_ j =0 j notequalto 2 t - t_j/t_3 - t_j = (t-t_0/t_3 - t_0) (t-t_1/t_3 - t_1) (t-t_2/t_3 - t_2); Your task is to build the subroutines of finding the coefficients using for-end loops instead of manually typing all the elements. Using Lagrange method of interpolation requires sequential calculation of differences for the coefficients of L_0, L_1, L_2 and L_3, such as t_0 = 10, v(t_0) = 227.04 t_1 = 15, v(t_1) = 362.78 t_2 = 20, v(t_2) = 517.35 t_3 = 22.5, v(t_3) = 602.97 L_0(t) = Product^3_ j =0 j notequalto 0 t - t_j/t_0 - t_j = (t-t_1/t_0 - t_j) (t-t_2/t_0 - t_2) (t-t_3/t_0 - t_3); L_1(t) = Product^3_ j =0 j notequalto 1 t - t_j/t_1 - t_j = (t-t_0/t_1 - t_0) (t-t_2/t_1 - t_2) (t-t_3/t_1 - t_3); L_2(t) = Product^3_ j =0 j notequalto 2 t - t_j/t_3 - t_j = (t-t_0/t_3 - t_0) (t-t_1/t_3 - t_1) (t-t_2/t_3 - t_2); Your task is to build the subroutines of finding the coefficients using for-end loops instead of manually typing all the elements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
