This preview shows page 1. Sign up to view the full content.
Unformatted text preview: >> average_cost = cost/. .. % command continuation items average_cost = 0.1142 2.3 Basic Mathematical Functions Matlab supports many mathematical functions, most of which are used in the same way you write them mathematically. Elementary math functions (enter help elfun for a more complete list): abs(x) Absolute value | x | sign(x) Sign, returns − 1 if x < 0, 0 if x = 0, 1 if x > exp(x) Exponential e x log(x) Natural logarithm ln x log10(x) Common (base 10) logarithm log 10 x sqrt(x) Square root √ x rem(x,y) Remainder of x/y . For example, rem(100,21) is 16. Also called the modulus function. 24...
View Full Document
- Summer '09