Chapter1-1c - TheMATLABEnvironment Chapter1...

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

View Full Document Right Arrow Icon
The MATLAB Environment Chapter 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
  Major Pieces Of Matlab Command window History window Documents windows (for editing) Help capabilities Plots Current directory Workspace 
Background image of page 2
  MATLAB as a Calculator Inside the command window, you have a  basic calculator, with standard  operations: +,*,-,/ and ^ (exponentiation) ( ) Order of operations (PEMDAS) % for comments
Background image of page 3

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

View Full DocumentRight Arrow Icon
 Defining Variables Examples:  x =10 Y=x    (assuming x had previous been given a value as shown  above) A1=3 Volume=(4/3)*pi*radius^3  (pi is a predefined variable  and assuming radius had previous been assigned a value – not  shown) Using the semicolon
Background image of page 4
 Naming Variables VERY IMPORTANT! MUST begin with a letter (a-z or A-Z). Followed by any combination of letters, numbers (0- 9) and the underscore (_) characters. (NO OTHER  CHARACTERS!) Maximum length of 63 characters but a max of 8  should be sufficient (abbreviate as necessary). MATLAB variables are case-sensitive (Cost, cost  and coSt are all different. I suggest you stick with all  lower case. Use the above for filenames (you’ll stay out of trouble).
Background image of page 5

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

View Full DocumentRight Arrow Icon
3 Sequential Coding  Examples Class Example1_1 (Cost of an item) Class Example1_2 (Deg F -> Deg C)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

Chapter1-1c - TheMATLABEnvironment Chapter1...

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

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