octave:3> B = [1 5 7; 2 -1 3] B = 1 5 7 2 -1 3 octave:4> 1:6 ans = 1 2 3 4 5 6 octave:5> 1:.5:4 ans = 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 octave:6> format long octave:7> 1:.5:4 ans = Columns 1 through 4: 1.00000000000000 1.50000000000000 2.00000000000000 2.50000000000000 Columns 5 through 7: 3.00000000000000 3.50000000000000 4.00000000000000 octave:8> format rat octave:9> 1:.5:4 ans = 1 3/2 2 5/2 3 7/2 4 octave:10> format short octave:11> A = [1 3 1; 2 2 -1] A = 1 3 1 2 2 -1 octave:12> A = [1 3 1; 2 2 -1]; octave:13> B = [A [3; 2]; 1 1 1 5] B = 1 3 1 3 2 2 -1 2 1 1 1 5 octave:14> B = [A; 1 1 1 5] error: number of columns must match (4 != 3) octave:14> B = [A [3; 2]; 1 1 1 5] B = 1 3 1 3 2 2 -1 2 1 1 1 5 octave:15> B' ans = 1 2 1 3 2 1 1 -1 1 3 2 5 octave:16> 1:6 ans = 1 2 3 4 5 6 octave:17> (1:6)' ans = 1 2 3 4 5 6 octave:18> 1:6' ans = 1 2 3 4 5 6 octave:19> octave:19> B B = 1 3 1 3 2 2 -1 2 1 1 1 5 octave:20> B(1,3) ans = 1 octave:21> B(2:3, :) ans = 2 2 -1 2 1 1 1 5 octave:22> B(2:3, 2:) parse error: syntax error >>> B(2:3, 2:) ^ octave:22> B(2:3, 2:4) ans = 2 -1 2 1 1 5 octave:23> B(2:3, [2 4]) ans = 2 2 1 5 octave:24> B B = 1 3 1 3 2 2 -1 2 1 1 1 5 octave:25> ones(5) ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 octave:26> zeros(5,1) ans = 0 0 0 0 0 octave:27> 3*ones(5,1) ans = 3 3 3 3 3 octave:28> diag( [ 1 2 3] ) ans = Diagonal Matrix 1 0 0 0 2 0 0 0 3 octave:29> det(diag( [ 1 2 3] )) ans = 6 octave:30> size(B) ans = 3 4 octave:31> log(10) ans = 2.3026 octave:32> log10(10) ans = 1 octave:33> help log `log' is a built-in function -- Mapping Function: log (X) Compute the natural logarithm, `ln (X)', for each element of X. To compute the matrix logarithm, see *note Linear Algebra::. See also: exp, log1p, log2, log10, logspace Additional help for built-in functions and operators is available in the on-line version of the manual. Use the command `doc ' to search the manual index. Help and information about Octave is also available on the WWW at http://www.octave.org and via the help@octave.org mailing list. octave:34> log([1 5 7]) ans = 0.00000 1.60944 1.94591 octave:35> log(1+i) ans = 0.34657 + 0.78540i octave:36> A = [1 2 3; 1 0 1; -1 1 2] A = 1 2 3 1 0 1 -1 1 2 octave:37> x = [1; 1; -1] x = 1 1 -1 octave:38> B = eye(3) B = Diagonal Matrix 1 0 0 0 1 0 0 0 1 octave:39> A*B ans = 1 2 3 1 0 1 -1 1 2 octave:40> B B = Diagonal Matrix 1 0 0 0 1 0 0 0 1 octave:41> A .* B ans = 1 0 0 0 0 0 -0 0 2 octave:42> A A = 1 2 3 1 0 1 -1 1 2 octave:43> B B = Diagonal Matrix 1 0 0 0 1 0 0 0 1 octave:44> A*x ans = 0 0 -2 octave:45> A A = 1 2 3 1 0 1 -1 1 2 octave:46> x x = 1 1 -1 octave:47> A.*x error: product: nonconformant arguments (op1 is 3x3, op2 is 3x1) octave:47> function y = f(x) > y = x^2; > end octave:48> f(5) ans = 25 octave:49> f(-21) ans = 441 octave:50> f([1 2 3]) error: for A^b, A must be square error: called from: error: f at line 2, column 3 octave:50> function y = f(x) > y = x.^2; > end octave:51> f(2) ans = 4 octave:52> f([1 2 3]) ans = 1 4 9 octave:53> mod(76, 3) ans = 1 octave:54> t = 'Alex' t = Alex octave:55> t[1] parse error: syntax error >>> t[1] ^ octave:55> t(1) ans = A octave:56> t(4) ans = x octave:57> t' ans = A l e x octave:58> quit