Unformatted text preview:

In this example we find some roots of several functions 1 Find the root of sin x near x 3 This should be Note an initial value or guess is needed to start this iteration In this case the starting value is 3 x fzero sin 3 x 3 1416 Well this was easy Note that the sin function is already defined What if the function is not already defined in Matlab In this case we make and save it ourselves For example suppose we want to solve for the value of x that would satisfy the equation sin x e x 5 This is the same as finding a root of sin x e x 5 0 First write and save the following as an m file called sss m function f sss x sss computes f sin x exp x 5 calling syntax f sss x f sin x exp x 5 Now it is easy to find the root make sure the path of Matlab can see where this script or m file is stored x fzero sss 1 initial guess at root is x 1 x 1 7878 Next we plot the function to see where the root s really are x 3 01 3 y sss x plot x y grid 5 0 5 10 15 3 2 1 0 1 2 3


View Full Document

UMD ENEE 474 - Some roots of several functions

Download Some roots of several functions
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Some roots of several functions and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Some roots of several functions and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?