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

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

View Full Document Right Arrow Icon
Background image of page 1

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

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

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

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

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

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

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

View Full DocumentRight Arrow Icon
1-8 The current environment for our computing session is called the workspace.
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 32

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

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

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