You are on page 1of 6

WEEK 5- VECTORS,

MATRICES AND
POLYNOMIAL
OPERATIONS
Name: Ralph Castro
Instructor: Professor L. Geng
Lab Date: 9/22/2016
Report Date: 9/29/2016

EET1102/D204 Fall2016

Contents
Introduction............................................................................................................................. 2

Objective...................................................................................................................... 2

Equipment.................................................................................................................... 2

Theoretical Background........................................................................................................... 2
Theories.................................................................................................................................. 2
Experiment Results and Analysis (Assignments and Practice).................................................4
Conclusions............................................................................................................................. 1
References.............................................................................................................................. 1

Introduction
Objective
The objective of this lab is to learn how to use MATLAB and
its features and functions that are needed to EET. This lab
will focus on using MATLAB to create vectors and matrices
and. With this ability you will be prepared for future lab
exercises.
Equipment
Dell Computer
Windows 7
MATLAB 2015

Theoretical Background
Scalars: Scalar variables are single values (i.e. dimensions of
1x1) The following are examples of scalar variable
creation/assignment.
Vectors: Vectors are one dimensional arrays. A 1xn vector is
knowns as a row vector since all n elements are located in a
single row. A nx1 vector is a column vector.
Matrices: Matrices are two dimensional arrays. If the
dimensions are N x N then it is called a square matrix. Matrices
can be composed explicitly or built up from vectors.

Theories
Sample Scalars
>> x = 5
>> y = 8.2e5
Sample Vectors
>> a = [0 1 2 3 4 5]
>> b = [0:5]
>> c = [0:1:5]
>> d = [0; 1; 2; 3; 4; 5]
2

Sample Matrices
>> h = [1 2 3; 4 5 6]
>> i = [1:3; 4:6]
>> j = i(1,:)

Experiment Results and Analysis (Assignments and


Practice)

5.

8.

9.

12.

>> A = [3 7 -4 12; -5 9 10 2; 6 13 8 11; 15 5 4 1;]


a)

>> v = A(:,2)

b)

>> w = A(2,:)

c)`

>> B = A(:, 2:4)

d)

>> C = A(2:4,:)

e)

>> D = A(1:2,2:4)

a)

>> max(A)

b)

>> max(A,[],2)

a)

<< B = sort(A)

b)

>> C = sort(A,2)

c)

>> D = sum(A)

d)

>> E = sum(A,2)

A)

>> A+B+C

B)

>> A-B+C

37.

>>f = [10 -9 -6 12]


g = [5 -4 -12 +8]
conv(f,g)

s2.

>> f = [2 5 -3]
roots(f)

s3

>> r1 = 2, r2 = -5
poly(r1), poly(r2)

Conclusions
In this lab, we found that MATLAB, is a high level
computation and simulation language that allows easy and
reliable manipulation of vectors and matrices. The initial core
of MATLAB was based on standard linear algebra libraries
and, in the 80s, became a popular tool for working with
linear systems. Since then, the software expanded in both
capabilities and acceptance.
This lab did focus on using MATLAB to create vectors
and matrices and. With this ability you were able to solve
different problems assigned by the professor.

References

You might also like