This preview shows pages 1–7. Sign up to view the full content.
CDA6530: Performance Models of Computers and Networks
Chapter 4: Using Matlab for Performance
Analysis and Simulation
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 2
Objective
Learn a useful tool for mathematical
analysis and simulation
Interpreted language, easy to learn
Use it to facilitate our simulation projects
A good tool to plot simulation/experiment
results figures for academic papers
More powerful than excel
Could directly create .eps for Latex
3
Introduction
MatLab :
Mat
rix
Lab
oratory
Numerical Computations with matrices
Every number can be represented as matrix
Why Matlab?
User Friendly (GUI)
Easy to work with
Powerful tools for complex mathematics
Matlab has extensive demo and tutorials
to learn by yourself
Use help command
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 4
Matrices in Matlab
To enter a matrix
2
5
3
6
4
1
>> A = [2 5 3; 6 4 1]
>> B = [1:1.5:6; 2 3 4 5]
>> for i=1:4
for j=1:3
C(i,j)=i*j;
end
end
>> D =[];
D=[D;5]; D=[D;6;7]
>> E = zeros(4, 5)
5
Basic Mathematical Operations
Remember that every variable can be a matrix!
Addition:
>> C = A + B
Subtraction:
>> D = A – B
Multiplication:
>> E = A * B
(Matrix multiplication)
>> E = A .* B (Element wise multiplication, A and B same size)
Division:
Left Division and Right Division
>> F = A . / B (Element wise division)
>> F = A / B = A*inv(B)
(A * inverse of B)
>> F = A . \ B (Element wise division)
>> F = A \ B=inv(A)*B
(inverse of A * B)
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 6
Matrix with ZEROS:
>> A = zeros(m, n)
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 01/14/2012 for the course CDA 6530 taught by Professor Zou during the Fall '11 term at University of Central Florida.
 Fall '11
 Zou

Click to edit the document details