25.08.2021 Views

082-Engineering-Mathematics-Anthony-Croft-Robert-Davison-Martin-Hargreaves-James-Flint-Edisi-5-2017

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.4 Using matrices in the translation and rotation of vectors 267

c*a

ans =

-2 -6

-4 -8

Multiplication ofascalar byamatrixis

commutative.Itdoes notmatter in which order the

calculation is performed. Each element in the matrix

ismultiplied bythe scalar value.

3 Thecalculations are valid but they do notproduce the

same result becausematrixmultiplication isnot

commutative.

c*d

ans =

23 31

34 46

>> d*c

ans =

19 43

22 50

Thisresult emphasizes the need forcare when

manipulating matrixequations.

4 Bothcalculations are valid but the resultsare not the

same.

e*f

ans =

f*e

ans =

9 19 29

12 26 40

15 33 51

22 49

28 64

5 de isnot valid asthere are 2 columns ind and 3 rows

ine. Itshould generate an error in atechnical

computing language. Itisworth observing the error

message andunderstanding why thishappensfor

future reference.

ed isvalid,

e*d

ans =

29 39

40 54

51 69

6 Itis valid. We takethisto mean the matrix

multiplication ofcbyitself:

c*c

ans =

7 15

10 22

Notice that thisisdifferent to taking the squareof

each element withinc. Ifwe wanted to dothat it

would be necessaryto use the ‘dot’ notation:

c.^2

ans =

1 9

4 16

Thecommandc.ˆ2means‘takeeach elementofcand

raiseitto the power of2.There is asetofoperators

within MATLAB ® which allow multiplication of

matrices onan element byelement basis.Care has to

be taken as(forexample)c ∗dandc. ∗dare both

valid operationswhich generate a3by 3 result but the

elements ofthe matrixare different. Inother words,it

could give an incorrect result but MATLAB ® would

not giveany error messages.

7 Itis notvalid. Itis only possibleto multiply amatrix

by itselfifthere are the same number ofcolumns as

rows.

8.4 USINGMATRICESINTHETRANSLATIONANDROTATION

OFVECTORS

There are many applications in engineering that require vectors to be manipulated into

newconfigurations.Onemechanismforachievingthisisbytheuseofmatrices.Wewill

introduce this topic through the example of robotics. However, it is important to note

thatthe ideas aremore generally applicable inengineering.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!