Professional Documents
Culture Documents
Chapter 2
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system,
or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to: Rights and
Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Objectives
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Objectives - continued
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Section 2.1
Getting Started
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB uses a
standard
windows menu
bar
To exit MATLAB
use the close
icon
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Section 2.2
MATLAB Windows
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
Workspace Window
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
Current Folder
Window
Lists files stored in the
current directory
100
Command Window
Enter commands at the prompt
200
MATLAB Windows
300
400
500
100
200
300
400
500
Command
History Window
Records all commands
issued in the command
window including
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
mistakes
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information
regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Command Window
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Command History
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Command History
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
It executes immediately
200
300
400
500
100
200
300
400
500
Workspace Window
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
Workspace Window
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
Scalar
100
Vector
200
300
400
500
100
200
300
400
500
2-D
Matrix
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Current Directory/Folder
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Document Window
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
New Variable
Icon
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Figure Window
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
Legends
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Editing Window
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Section 2.3
Solving Problems with MATLAB
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Variables
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Naming Variables
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
iskeyword
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
ans =
'break'
'case'
'catch'
'classdef'
'continue'
'else'
'elseif'
'end
'for
'function'
'global'
'if'
'otherwise'
'parfor'
'persistent'
'return
spmd
'switch'
'try'
'while'
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
test
Test
ifx
x
my-book
my_book
Thisisoneverylongnamebutisitstillallowed?x
x
1stgroup
group_one
zzaAbc
z34wAwy?12#
x x
sin
bad
log
idea
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Scalar Calculations
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
>> 9 + 10
ans=19
400
500
100
200
300
400
500
Result
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Assignment Operator
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Yes!!!
In algebra this is not a true statement
x=x+1
In computers (assignment statements)
it means replace the value in the
memory location named x, with a new
value equal to x+1
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Order of Operation
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Order of Operation
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
5*(3+6)
= 45
5*3+6
= 21
100
200
300
400
500
100
200
300
400
500
5*3 + 6
= 21
Parentheses
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
Use only ( )
{ } and [ ] mean something
different
MATLAB does not assume
operators
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
5*6/6*5 = 25
5*6/(6*5)
= 1
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Heres an example
Find the surface area of a cylinder
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
r = radius
r=5
h = height
h = 10
r2
2 r * h
100
200
r2
300
400
500
100
200
300
400
500
SA 2r 2rh 2r (r h)
2
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Array Operations
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Shortcuts
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
To calculate spacing
between elements use
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
linspace
logspace
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Hint
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
Multiplication between
arrays is performed on
corresponding elements if
the .* operator is used
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Array Operations
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
Array multiplication
Array division
Array exponentiation
.*
./
.^
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
More about pi
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Transpose
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
The transpose
operator works on both
one dimensional and
two dimensional arrays
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Number Display
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Scientific Notation
Although you can enter any number in
decimal notation, it isnt always the best
way to represent very large or very small
numbers
In MATLAB, values in scientific notation
are designated with an e between the
decimal number and exponent. (Your
calculator probably uses similar notation.)
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Display Format
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Default
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Other formats
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
Common Scale
Factor
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
format +
format rat
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
format compact
format loose (default)
100
200
300
400
500
100
200
300
400
500
Section 2.4
Saving Your Work
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
MATLAB automatically
saves to a .mat file
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Again Remember that the only things being saved are the
values stored in the workspace window not the commands
from the command window
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Script M-files
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
This arrangement is
often easier to use
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
When I
execute the
file, the figure
appears on
top of the
MATLAB
desktop
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Comments
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Cell Mode
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Cell Toolbar
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
Cell Dividers
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.
Summary
Rate of Change
-5
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1.5
2.5
time, hour
3.5
4.5
100
200
300
400
500
100
200
300
400
500
MATLAB for Engineers 3E, by Holly Moore. 2011 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.
This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to:
Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.