lecture 1: using matlab - mit opencourseware · lecture 1: using matlab • using matlab •...

33
Lecture 1: Using Matlab Using Matlab Setting Up for Matlab Basic Calculations The Matlab “Environment” Matlab Functions Matrix Math Matrix Math A Motivating Example Examine the Lift Linkage Model a System of Forces Support Forces Forces on the Bin System of Equations What Force for 10lbs Weight? What about other Weights? Call the m-file Expand the m-file The Matrix Determinant Plotting Data in Matlab Matlab plots data, not functions A Motivating Example Cool Time Data Plotting Data Why an Exponential Look? Convective Cooling Curve Fitting Transform Data to a Linear Form Plot the Ln Data Find the Least Squares Fit Plot both Data and Line Formatting Plots Plot the Exponential Equation

Upload: others

Post on 28-May-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Lecture 1: Using Matlab

• Using Matlab • Setting Up for Matlab • Basic Calculations • The Matlab “Environment” • Matlab Functions • Matrix Math • Matrix Math • A Motivating Example • Examine the Lift Linkage • Model a System of Forces • Support Forces • Forces on the Bin • System of Equations • What Force for 10lbs Weight? • What about other Weights? • Call the m-file • Expand the m-file • The Matrix Determinant • Plotting Data in Matlab • Matlab plots data, not functions • A Motivating Example • Cool Time Data • Plotting Data • Why an Exponential Look? • Convective Cooling • Curve Fitting • Transform Data to a Linear Form • Plot the Ln Data • Find the Least Squares Fit • Plot both Data and Line • Formatting Plots • Plot the Exponential Equation

Page 2: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Notes:

This the first day of matlab, and presumes you have sat through the “Introduction to Matlab” training session.

Page 3: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Notes:

First you need to set up your athena (server) environment to be matlab-happy.

Page 4: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Notes:

Matlab does basic calculations as you would expect.

Page 5: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Notes:

In matlab, you can do all the UNIX commands.

There is an idea of the matlab workspace. As you define variables and formulas, they are stored, overwritten, expanded, deleted. But there is a state of the matlab environment at any point.

You may choose to leave matlab because of time pressure. You can store the state of matlab with a save command. Then quiot matlab, and leave. Later, after starting matlab, just enter load, and the file matlab.mat will be loaded, which restores the state of matlab to what it was when you did the save.

Page 6: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Notes:

There are many matlab functions..

Page 7: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 8: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Notes:

lets try some matrix math.

Page 9: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through

Notes:

Now lets see how we might use this.

Page 10: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 11: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 12: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 13: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 14: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 15: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 16: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 17: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 18: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 19: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 20: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 21: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 22: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 23: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 24: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 25: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 26: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 27: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 28: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 29: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 30: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 31: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 32: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through
Page 33: Lecture 1: Using Matlab - MIT OpenCourseWare · Lecture 1: Using Matlab • Using Matlab • Setting Up for Matlab ... This the first day of matlab, and presumes you have sat through