CS 1112 Chapter Notes - Chapter 1.1: Semicolon, Inverse Trigonometric Functions
Document Summary
Variables and assignment: a value is assigned to a variable using the equals operator (=) Variables can be used inside of fprintf statements: Example fprintf("the area of the pyramid is: %6. 3f \n", area); %6. 3f is placed where the value of the variable is going to be displayed. F specifies that the variable is a double (number with a decimal) 6 is the number of spaces allotted for the display of the variable. 3 is the number of decimal places displayed. More than one variable can be used. Errors are present in every calculation since models are 100% accurate and there is some round off error present in constants and calculations run by the computer. Mathematical constants and functions: pi is a constant in matlab, sqrt(insert number here) is used to find the square root, log(insert number here) is used to find the natural logarithm of a number.