MATLAB Tutorial for Calculus III - Part 1
Contents
1 Introduction to MATLAB 1
1.1 Logging into the system . . . .................................... 2
1.2 Starting out with MATLAB . .................................... 2
2 MATLAB as scientific calculator 3
2.1 Introduction to calculations . .................................... 3
2.2 Assigning variables in MATLAB . . . . . ............................. 4
2.3 Help in MATLAB . . ........................................ 5
2.4 Exponents in MATLAB . . . .................................... 6
2.5 Built-in MATLAB functions . .................................... 6
2.6 Exercises ............................................... 8
3 Symbolic computations 8
3.1 Introduction to symbolic variables . . . . ............................. 8
3.2 Finding solutions to equations .................................... 10
3.3 Substitution . . ............................................ 11
3.4 Symbolic versus numeric computation . . ............................. 12
3.5 Symbolic calculus with MATLAB . . . . . ............................. 13
3.6 Exercises ............................................... 15
4 Plotting 16
4.1 Making2Dplots ........................................... 16
4.2 Example:afunctionandthetangentlineonthesameplot ................... 19
4.3 Polar plots . . ............................................ 20
4.4 Curvesinspace............................................ 21
4.5 3D vectors . . . ............................................ 21
4.6 Equation of a plane . . ........................................ 22
4.7 Two intersecting planes . . . .................................... 25
4.8 Surfacesinspace ........................................... 26
4.9 Exercises ............................................... 26
1 Introduction to MATLAB
MATLAB is a powerful computer algebra system that can perform many mathematical calculations. It can
also be used as a programming language. This lab is intended to introduce both of these capabilities. The
MATLAB program is available to UCCS students in the computer lab in EAS 136.
1
1.1 Logging into the system
On the log-in screen, you will see a prompt for your username and password. Type in your username first.
This will be the first letter of your first name followed by the first seven letters (or less) of your last name.
For example, if your name is John Williams, then your username will be JWilliam.
If you have not previously logged in, you will need the initial password. The initial password is MmmssssL
where:
• Mmm = first 3 letters of your birthmonth
• ssss = last 4 digits of your student ID number
• L = first letter of last name
• (The first and last letters are capitalized.)
After you log in you will be asked to change this password, make sure you remember it!
**Note: If for some reason either your username or your password does not work, first check that the
DOMAIN is set to UFP. If it still doesn’t work, ask someone for help.
1.2 Starting out with MATLAB
Double click the MATLAB icon on your screen. This will start the MATLAB program, and the MATLAB
desktop appears.
The MATLAB desktop is divided into three smaller windows. On the upper left you will see the ”Current
Directory” subwindow. We will not be using this, so remove it by clicking the small ”x” in the upper right
corner of the subwindow. Now the ”Workspace” subwindow appears; remove this also. Then remove the
”Command History” subwindow. Now the only subwindow that is left is the ”Command” subwindow. You
should see a prompt in the Command window that looks like this: ”>>”.
2