rem(31,5) 1 rem(-31,5) -1 exp(0) 1 rem(34,5) 4 rem(-34,5) -4 exp(-5.145) 0.0058 log base e log base 10 log(x) log10(x) log(exp(1)) 1 log10(exp(1)) 0.4343 log10(51.145) 1.7088 log(10) 2.3026 factorial x! random number 0 to 1 factorial(x) rand factorial(4) 24 rand 0.9318 rand(2,3) 0.4660 0.8462 0.2026 0.4186 0.5252 0.6721 a = 1; b = 10; floor(a + b*rand) random integer from 1 to 10 ? rand('state', sum(100*clock)) reset random number generator, so different results are obtained date clock s = date; s 04-Oct-2003 clock = [year month day hour minute seconds] fix(clock) 2003 10 4 16 23 35 starts a seconds counter etime tic difference in seconds between stops the seconds counter toc two dates T0 = [2000 10 15 0 0 0] T1 = [2004 10 10 12 0 0] etime(T1,T0) 125841600 cputime elapsed CPU time in seconds a = cputime a = 1.811010000000000e+003 eval feval evaluates a string expression executes functions specified by strings s = '123' a = eval(s) a = 123 (press Enter) global … defines global variables Long lines converted into short lines y = amp1*sin(2*pi*x/lambda1) …
rem(31,5) 1 rem(-31,5) -1 rem(34,5) 4 rem(-34,5) -4 exp(0) 1 exp(-5.145) 0.0058 log(x) log base e log(exp(1)) 1 log(10) 2.3026 log10(x) log base 10 log10(exp(1)) 0.4343 log10(51.145) 1.7088 factorial(x) factorial x! factorial(4) 24 rand random number 0 to 1 rand 0.9318 rand(2,3) 0.4660 0.8462 0.2026 0.4186 0.5252 0.6721 a = 1; b = 10; floor(a + b*rand) random integer from 1 to 10 ? rand('state', sum(100*clock)) reset random number generator, so different results are obtained date s = date; s 04-Oct-2003 clock clock = [year month day hour minute seconds] fix(clock) 2003 10 4 16 23 35 etime difference in seconds between two dates T0 = [2000 10 15 0 0 0] T1 = [2004 10 10 12 0 0] etime(T1,T0) 125841600 tic starts a seconds counter toc stops the seconds counter cputime elapsed CPU time in seconds a = cputime a = 1.811010000000000e+003 eval evaluates a string expression s = '123' a = eval(s) a = 123 feval executes functions specified by strings global defines global variables … (press Enter) Long lines converted into short lines y = amp1*sin(2*pi*x/lambda1) …