# lect01 - What is the Matl ab env ironment How can you creat...

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

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

View Full Document
1-2 What is the Matlab environment? How can you create vectors ? What does the colon : operator do? How does the use of the built-in linspace function differ from the use of the colon : operator? Readings: Matlab by Pratap Chapter 3.
3 1) engineering visualization and computation software 2-D contour, histogram, line, mesh, polar, polygon and scatter plots. 3-D line, mesh, polygon, scatter and wire frame plots. 1) The “interactive environment” is user friendly. 1) MATLAB provides its own high-level language in which users can extend the capabilities of MATLAB. C-like programming language Many user defined functions

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

View Full Document
1-4 MATLAB is interactive, if you type (without ; ) >> 2 + 3 The system responds with ans = 5 ans ” is a built-in variable that contains the results of the last evaluated expression that has not been assigned to another variable. e.g. if we type >> 3 * 3 ans = 9
1-5 To suppress the screen output use a semicolon: >> 5 ^ 2; (“ ^ ” is the power operator, 5 raised to the second power in this example) >> ( no response from matlab) To examine the current value of ans type >> ans ans = 25

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

View Full Document
1-6 All variables are created as array variables. For example, >> x = 1.5; (this is called an “assignment statement”) creates a (1 x 1) array of type real and assigns the value 1.5 to x. Variables only change values when you assign values to them using an assignment statement. To see the value of x type, >> x x = 1.5000 Variable names must begin with a character and are case sensitive. 1.5 x RAM
1-7 The variable to be “assigned” a value must be on the left hand side of the assignment statement… >> 1.5 = x; (illegal “assignment statement”) The above is illegal because “1.5” does not specify a legal address in memory. An assignment statement is not a “math” equation. For example, the following sequence is legal in Matlab: >> x = 2.0; >> x = x + 1.0 x = 3.0000

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

View Full Document
1-8 The current environment for our computing session is called the workspace.
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 03/04/2009 for the course CS 101 taught by Professor Gambell during the Spring '08 term at University of Illinois at Urbana–Champaign.

### Page1 / 32

lect01 - What is the Matl ab env ironment How can you creat...

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

View Full Document
Ask a homework question - tutors are online