THE
UNIVERSITY OF TEXAS AT AUSTIN
Department of Chemical Engineering•Austin, Texas 787121062•(512)4715238•FAX(512)4717060
ChE 210
Homework 12
Due:
Monday, May 3
This assignment demonstrates how basic MATLAB numerical routines interact with
user written MATLAB functions.
These routines are simple examples of those used in
future courses such as ChE 348 and ChE 372.
1. Write the following function as a MATLAB function myfunction( x ) in an mfile.
The
function should accept both scalar and vector arguments for x.
)
2
cos(
4
5
.
0
x
y
x

=
a. Calculate and plot the function for values of x from 0 to 5 in increments of
0.01.
Don’t worry too much about graph labels, but do add a line (not a
grid) that goes from (2,0) to (4,0).
b. Find an accurate value of the first positive root (first greater than zero, it’s
near 0.75) of the function using the MATLAB function
fzero
.
c.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '10
 HICKENBOTTOM
 Microeconomics, Thermodynamics, Department of Chemical Engineering•Austin

Click to edit the document details