Introduction to MATLAB & SIMULINK: A Project Approach, Third Edition

Appendix A: Table of Arithmetic MATLAB Operations

OVERVIEW

The following tables summarize the application of arithmetic operations in MATLAB as matrix and field operations.

Here, we shall use the matrices


and the vectors


as examples of matrices and vectors.

A.1 ARITHMETIC OPERATIONS AS MATRIX OPERATIONS

The first table summarizes the arithmetic operations of MATLAB as matrix operations.

Operation in MATLAB

Effect

Example

A+B

matrix addition


A-B

matrix subtraction


a+b

vector addition


A*B

matrix multiplication


a*b (error!)

undefined!

-3*B

scalar multiplication


A\B

left division


A/B

right division


Operation in MATLAB

Effect

Example

A 2

raising to a power (exponentiation)


2 A (error!)

undefined!

a 2 (error!)

undefined!

A.2 ARITHMETIC OPERATIONS AS FIELD OPERATIONS

The following table shows the contrasting arithmetic operations of MATLAB as field operations.

Operation in MATLAB

Effect

Example

A.+B (error!)

meaningless, since A + B is already term-by-term

A.-B (error!)

meaningless, since A - B is already term-by-term

a.+b (error!)

meaningless, since is already term-by-term

A.*B

term-by-term product


a.*b

term-by-term product


-3.*B (OK!)

scalar multiplication

see Table A.1

A.\B

term-by-term division


A./B

term-by-term division


A. 2

term-by-term exponentiation


2 A

2 raised to powers given by matrix terms


a. 2

term-by-term exponentiation


UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Arithmetic Logic Units (ALU)
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.