ENCMP100 Lecture Notes - Lecture 2: Matlab

36 views2 pages

Document Summary

X=x+1 is nonsense in mathematics language: however, in matlab, x=x+1 is called an incrementation. In math, 5=x and x=5 are the same. However in matlab, 5=x and x=5 do not mean the same thing: default variable in matlab is assigned as "ans, a ";" will suppress the print output in the command window. Spaces do not affect the code in matlab, it only helps readability: key word/ reserved words cannot be used as variable names, a variable take precedence over function. "whos" allows user to find all assigned variables in the command window. "doc variable" opens all documentations about the variable. "format short" displays output of digits to 4 decimal places. "format long" displays output of digits to number of decimal places equivalent to 8 bytes storage. "help variable" displays information about the variable on the command window. "abs(variable)" will give absolute value of the variable. Calculations: math- multiplication can be represented by 2. 3 or 2x3 or 2a.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents