EE105 Matlab Tutorial
EE105 Matlab Tutorial
Abstract and how to plot data with axes labels, grids, and
legends1 .
The objective of this laboratory is to familiarize the stu- Do not just read passively. Instead, while reading,
dent with the usage of MATLAB as an tool for engineering enter the examples and make sure that you can make
problem solving. MATLAB will be used in all labs related them work.
to this course.
3. Matrices and Arrays. A main goal is to make sure
that you know the basic methods for using Matlab as
1 Background a matrix manipulation tool; therefore, complete the
following.
Matlab is an engineering tool used for computations, in-
In the Matlab command window, use matrix opera-
cluding matrix algebra and simulation, which are two key
tions to find the matrix C:
topics of this course.
This lab will show you how to figure out command A = [π; sqrt(2); exp(1)] (1)
names for functions that you might want to compute and
B = [1; 5; 7] (2)
will familiarize you with Matlab through a few simple
programming exercises. C = A⊤ B (3)
3 Lab Report If any of the above are ignored, the figure may be
ignored at the grader’s discretion
This weeks lab report should only be a few pages long.
Answer the questions from the lab. Include and discuss 2. The extent of the axis should be optimized to com-
the graphs that are requested. There is very little code municate the maximum amount of information.
that actually needs to be turned in. 3. The type of graph (e.g., loglog, semilog, rectan-
gular, hist) used should be carefully considered.
3.1 Grading of this lab report For example, the following sequence of data:
t- 1 2 3 4 5 6 7
The TA will describe the method that will be used to x - 1e5 3 .5 .05 .005 .0005 .000005
grade the report. Points will be given for clarity and conveys much more information using the ‘semil-
correctness of the figures, code, and report discussion. ogy(t,x)’ graph than the ‘plot(t,x)’ graph. Try both
and see for yourself.
4 Lab Report Guidelines 4. Use ‘subplot’ to fit various related graphs on the same
page to make comparison easy and to save trees.
The following guidelines apply to every lab report that
you will turn in this quarter. The guidelines will not be
repeated in each lab description. 7 Code Guidelines
1. Each student (not each group) must turn in his or
Avoid componentwise operations on vectors and matrices
her own lab report.
to the greatest extent possible.
2. Every lab report should be as short as possible while Any code printouts that you turn in,
still communicating to the grader that you under-
1. must be well organized
stand all aspects of the lab. Excess length or print-
outs will lower your grade. 2. must be well commented
3. Proper use of English grammar will increase your 3. must be discussed by name in the lab report.
grade.