AE202 Lecture 1 Matlab Introduction

AE202 Lecture 1 Matlab Introduction - AE202 Aerospace...

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

View Full Document Right Arrow Icon
AE202 Aerospace Flight Mechanics Lecture 1: Introduction to MATLAB
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
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
Background image of page 5

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

View Full DocumentRight Arrow Icon
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
Background image of page 6
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)
Background image of page 7

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
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.
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online