Engineering Fundamentals: An Introduction to Engineering, 4th ed.c

(Steven Felgate) #1
vehicle, you not only have to specify how fast it is moving (speed), but also its direction. The
physical variables that possess both magnitude and direction are calledvectors.
There are also other quantities that require specifying more than two pieces of information.
For example, if you were to describe the location of a car parked in a multi-story garage (with re-
spect to the garage entrance), you would need to specify the floor (thezcoordinate), and then
the location of the car on that floor (xandycoordinates). Amatrixis often used to describe
situations that require many values. In general, a matrix is an array of numbers, variables, or ma-

thematical terms. To define the elements of a matrix, for example [A]  ,
you type

A = [1 5 0;8 3 7;6 2 9]


£


150


837


629


§


464 Chapter 15 MATLAB


TABLE 15.1 MATLAB’s Basic Scalar (Arithmetic) Operators


Example:
Operation Symbol x5 and y 3 Result

Addition  xy8
Subtraction  xy2
Multiplication * x*y 15
Division / (xy) /2 4
Raised to a power ^ x^2 25

■Figure 15.2
Examples of assigning values or
defining elements of a matrix
in MATLAB.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).

圀圀圀⸀夀䄀娀䐀䄀一倀刀䔀匀匀⸀䌀伀䴀圀圀圀⸀夀䄀娀䐀䄀一倀刀䔀匀匀⸀䌀伀䴀

Free download pdf