CPS 118 Chapter Notes - Chapter 3: Reserved Word, Common Logarithm, Semicolon

128 views4 pages

Document Summary

Functions can be thought of as a black box that takes an input, does a computation with it, and produces an output. A function has to have a name in matlab. A function(cid:495)s arguments can be numbers or variables or expressions involving. It can produce 0 or more outputs number/variables/functions. Some elementary math functions are: sqrt(x, nthroot(x,n) nth real root, exp(x) e to the power of x, abs(x) absolute value, log(x) natural log (log base e, log10(x) log base 10, factorial(x) - x! Some elementary trigonometric functions: sin(x) sine in radians, sind(x) sine in degrees, cos(x, cosd(x, tan(x, tand(x, cot(x, cotd(x) A variable is a name that is assigned a numerical value. Once assigned, it can be used in expressions, functions, and matalb statements and commands. Writing to the variable sets its value. To assign 3 to a, write a=3. You cannot do 3=a because you cannot set 3 to the value of (cid:494)a(cid:495)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents