{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture2 - EGR 106 Lecture 2 Scripts and Arrays Brief...

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

View Full Document Right Arrow Icon
EGR 106 Lecture 2 Scripts and Arrays Brief Review of Last Week Scripts and the Editor Arrays: Concept Construction Addressing Textbook 1.8, 1.9. 2.1-2.3
Background image of page 1

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

View Full Document Right Arrow Icon
Review of Last Week Variables: placeholders for numerical data equal sign is an assignment operator naming restrictions (not pi, etc. ) can be complex valued ( x = 3 + 7 i ) Basic math on numbers and variables: + * / ^
Background image of page 2
Scripts – Simple Programs So far, commands have been typed in the command window: Executed by pressing “enter” Edited using the arrow keys or the history window This is a very tedious method to use MATLAB, and so we want to learn how to write savable computer programs or codes
Background image of page 3

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

View Full Document Right Arrow Icon
Script (m-file) Concept A file containing Matlab commands Can be re-executed Is easily changed/modified Is savable and can be e-mailed to someone Commands are executed one by one, sequentially File is executed by typing its name (without .m) Results appear in the command window (or use ; ) Can be created using any text editor .m extension Listed in Current Directory window
Background image of page 4
Can be run in the Command Window
Background image of page 5

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

View Full Document Right Arrow Icon
Matlab’s Built-in, C o l o r Editor: Can create a new file or open an existing M-file (icons or click on file name) C o l o r used to aid in file creation (command types, typos, etc.) Opens Editor Window to Create New M-File Opens an Existing File in Editor Window to Edit & Save
Background image of page 6
Opening Editor Window Opens Editor Window to create new program In this window: - type & edit commands - test & run program - save work when finished
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}