Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Numerical analysis image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago