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

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 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 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: + * / ^ 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 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 Can be run in the Command Window Matlabs 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 Opening Editor Window Opens Editor Window to create new program In this window: - type & edit commands- test & run program- save work when finished...
View Full Document

Page1 / 32

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online