Numerical analysis
4. (a) Write a MATLAB function file and call it myfunc to evaluate the function y(x) 3x-24x +56x-32, where y should be the output array and x is the input array (b) Give all commands that you must type in the MATLAB command window to plot y in the vertical direction (or along the vertical axis) and x in the horizontal direction (or horizontal axis) using the function file myfunc for x varying from 0 to 1 with an interval of 0.02. Write your commands such that the plot also shows the grid lines. (c) The equation y(x) = 3x3-24x2 +56-32-0 is now solved using the MATLAB code Newton.m. This program is called from the command window in the following manner (2 x 4) [x, y] -Newton(myfunc, myfunc pr, 0, 0.001, 50); Write the MATLAB function file myfunc pr.m for solving this equation (d) Let us assume that you have created and saved a function file Gauss_pivot.m for solving a linear system of equations. The first line of the function file is function x Gauss pivot(A,b) where 'A' is the coefficient matrix and d'is the right hand side vector. Give all commands that you must type in the MATLAB command window to solve the system of equations of problem 1 with A B-2 4. (a) Write a MATLAB function file and call it myfunc to evaluate the function y(x) 3x-24x +56x-32, where y should be the output array and x is the input array (b) Give all commands that you must type in the MATLAB command window to plot y in the vertical direction (or along the vertical axis) and x in the horizontal direction (or horizontal axis) using the function file myfunc for x varying from 0 to 1 with an interval of 0.02. Write your commands such that the plot also shows the grid lines. (c) The equation y(x) = 3x3-24x2 +56-32-0 is now solved using the MATLAB code Newton.m. This program is called from the command window in the following manner (2 x 4) [x, y] -Newton(myfunc, myfunc pr, 0, 0.001, 50); Write the MATLAB function file myfunc pr.m for solving this equation (d) Let us assume that you have created and saved a function file Gauss_pivot.m for solving a linear system of equations. The first line of the function file is function x Gauss pivot(A,b) where 'A' is the coefficient matrix and d'is the right hand side vector. Give all commands that you must type in the MATLAB command window to solve the system of equations of problem 1 with A B-2