AE202 Lecture 1 Matlab Introduction

AE202 Lecture 1 Matlab Introduction - AE202 Aerospace...

This preview shows pages 1–10. Sign up to view the full content.

AE202 Aerospace Flight Mechanics Lecture 1: Introduction to MATLAB

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
What is MATLAB High-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numeric computation Produced by Mathworks (Boston, MA) First sold in February 1985 to MIT MATrix LABoratory – Primary data type is a Matrix
Why do we use MATLAB Matrix based like many engineering calculations Interactive unlike C++ or Java High-level – Strong Abstraction from details of computer – Hiding of details is generally intended to make the language user-friendly – MATLAB handles the initialization of variables and memory usage Easy to program Lots of inbuilt functions Good data visualization Disadvantages – Slow – Large overhead

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Numerical Computation MATLAB will do exactly what you tell it to do – Garbage In, Garbage Out. Don’t immediately trust the computational result. Assume result is incorrect until proven otherwise. Does the result make sense ? – Size and type of returned variable/s – Order of magnitude Test functions with problems that have known solutions
Getting Started • MATLAB is on all the computers in Talbot Computer Lab 321D • MATLAB available from CITES – Download: free – On DVD: \$5.00 • Virtual Private Network (VPN) – Needed to run MATLAB from outside UIUC network. – Setup depends on Operating system – Instructions on CITES

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Simple Arithmetic Can enter simple (or complicated) expressions into the command window and receive answers + , - , * , / , ^ , \ , sin , cos , log , exp, etc. – e.g. >> 7 * 8 >> cos(1) - argument is in radians Use semi-colon to suppress output Can have multiple operators in one expression Operator precedence – 1 Parentheses – 2 Power, left to right – 3 Multiplication and division, left to right – 4 Addition and subtraction, left to right
How MATLAB handles undefined numbers Some operations don’t have defined answers – e.g • 1/0 • 0/0 MATLAB has two values for undefined numbers (NaN & Inf) – Infinity (Inf) & Not -a-Number (NaN)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Complex Numbers Some operations result in complex numbers – e.g. • log(-1) , for a > 1 or a < -1 Most of MATLAB’s standard equations handle complex numbers – Will return complex numbers as results – Accept complex numbers as inputs Be careful not to reassign i 1 sin a 1 cos a 1
Assigning Variables = is the assignment operator – e.g a = 27.13 – Will put the value 27.13 in the variable labeled a Variable names must: – start with a letter – be no more 63 characters – no spaces or operators (*,+,-, etc) No variable declaration necessary Case sensitive Variables placed in workspace Can overwrite function names e.g.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 30

AE202 Lecture 1 Matlab Introduction - AE202 Aerospace...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online