# 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.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern