02-Jul-2023 18:16:52 exm_test(): MATLAB/Octave version 5.2.0 exm() is the "Experiments with MATLAB" library. calendar_test(): Current time using "bank" format: 2023 7 2 18 16 52.492 Is 2023 a leap year? Answer is false dnum = 739069.76 dnow = 739069.00 xmas = 739245.00 days_till_xmas = 176.00 wday = Sun c = 687 685 685 687 684 688 684 bday = 708434 Graphics saved as "biorhythm.png" checkerboard_test(): checkerboard(n) returns an nxn checkerboard matrix. 1 0 1 0 1 0 1 0 1 f = 0 0 0 0 0 0 0 0 t = 1 2 3 4 5 6 7 8 s = 1 2 3 5 8 13 21 34 f = 1 2 3 5 8 13 21 34 Elapsed time is 1.51093 seconds. f = 1 2 3 5 8 fpf = 2 4 6 10 16 ftf = 1 4 9 25 64 ff = 1 4 9 25 64 ffdf = 1 2 3 5 8 cosfpi = -1 1 -1 -1 1 even = 0 1 0 0 1 r = 2 3/2 5/3 8/5 'hello_world' is a function from the file /home/john/public_html/octave_src/exm/hello_world.m *****************************************************************************80 hello_world() prints a traditional greeting. Discussion: Programming languages are traditionally introduced by the phrase 'hello world'. Here is a demo of some MATLAB capabilities. Usage: publish hello_world Licensing: Copyright 2014 The MathWorks, Inc. Author: Cleve Moler Reference: Cleve Moler, Experiments with MATLAB https://www.mathworks.com/moler Additional help for built-in functions and operators is available in the online 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 https://www.octave.org and via the help@octave.org mailing list. h = hello world ans = h e l l o w o r l d ans = dlrow olleh ans = d l r o w o l l e h ans = h e l l o w o r l d ans = dehllloorw x = Columns 1 through 7: 104 101 108 108 111 32 119 Columns 8 through 11: 111 114 108 100 ans = hello world ans = w ans = khoor#zruog H = HELLO WORLD inregion_test(): inregion() reports whether a point is inside or on the boundary of a polygonal region. Blue points inside, red points on boundary. Graphics saved as "inregion_test.png" iteration_test() ans = 1.2346 ans = 1.234567901234568 x = 42 phi = 1.6180 Avogadros_constant = 6.0221e+23 camelCaseComplexNumber = -3 + 4i ans = 42 ans = 42 ans = 42 ans = 42 ans = 42 ans = 42 x = 6.5574 x = 2.7491 x = 1.9363 x = 1.7136 x = 42 6.5574 2.7491 1.9363 1.7136 1.6473 1.6270 1.6208 1.6189 1.6183 1.6181 1.6181 1.6180 k = 12 k = 1 2 3 4 5 6 7 8 9 10 11 12 x = 0.00000 0.10000 0.20000 0.30000 0.40000 0.50000 0.60000 0.70000 0.80000 0.90000 1.00000 19 4 0.211 A = 3.00 12.00 1.00 12.00 0.00 2.00 0.00 2.00 3.00 b = 2.36 5.26 2.77 x = 0.29 0.05 0.89 x = 0.29 0.05 0.89 A = 3.00 12.00 1.00 12.00 0.00 2.00 6.00 0.00 1.00 ans = 0.43 0.08 0.08 b = 2.36 5.26 2.63 x = 0.44 0.09 0.00 ans = 2.36 5.26 2.63 z = -0.16 -0.04 0.99 ans = 0.00 0.00 0.00 t = 0.06 y = 0.43 0.08 0.06 ans = 2.36 5.26 2.63 A = 8 1 6 3 5 7 4 9 2 ans = 15 15 15 ans = 15 15 15 ans = 15 ans = 15 ans = 15 ans = 8 1 6 3 5 7 4 9 2 ans = 8 3 4 1 5 9 6 7 2 ans = 6 7 2 1 5 9 8 3 4 ans = 4 9 2 3 5 7 8 1 6 ans = 2 9 4 7 5 3 6 1 8 ans = 2 7 6 9 5 1 4 3 8 ans = 4 3 8 9 5 1 2 7 6 ans = 6 1 8 7 5 3 2 9 4 Variables in the current scope: Attr Name Size Bytes Class ==== ==== ==== ===== ===== X 648x509 2638656 double caption 2x28 56 char map 128x3 3072 double Total is 330272 elements using 2641784 bytes A = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 A = 16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1 ans = 15 34 65 111 175 260 369 505 n = 5 M = 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9 n = 4 M = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 'ismagical' is a function from the file /home/john/public_html/octave_src/exm/ismagical.m *****************************************************************************80 ismagical() checks various magic aspects of square matrices. Discussion: m = ismagical(A) is a logical vector with four elements indicating: m(1) = Semimagic: all column sums and all row sums are equal. m(2) = Magic: semimagic and both principal diagonals have the same sum. m(3) = Panmagic: magic and all the broken diagonals have the same sum. m(4) = Associative: all pairs of elements on oppositve sides of the center have the same sum, which must be twice the center value. Licensing: Copyright 2014 The MathWorks, Inc. Author: Cleve Moler Reference: Cleve Moler, Experiments with MATLAB https://www.mathworks.com/moler Additional help for built-in functions and operators is available in the online 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 https://www.octave.org and via the help@octave.org mailing list. ans = 1 1 0 1 ans = 1 1 0 1 ans = 1 1 0 1 ans = 1 1 0 0 ans = 1 1 0 1 ans = 1 1 0 1 ans = 1 1 0 1 ans = 1 1 0 0 c = Columns 1 through 16: 32 32 32 32 32 32 11 7 6 5 4 3 3 3 2 2 32 32 32 32 32 32 32 9 6 5 4 3 3 3 2 2 32 32 32 32 32 32 32 32 7 5 4 3 3 3 2 2 32 32 32 32 32 32 32 32 27 5 4 3 3 3 2 2 32 32 32 32 32 32 32 32 30 6 4 3 3 3 2 2 32 32 32 32 32 32 32 32 13 7 4 3 3 3 2 2 32 32 32 32 32 32 32 32 14 7 5 3 3 2 2 2 32 32 32 32 32 32 32 32 32 17 4 3 3 2 2 2 32 32 32 32 32 32 32 16 8 18 4 3 3 2 2 2 32 32 32 32 32 32 32 11 6 5 4 3 3 2 2 2 32 32 32 32 32 32 32 19 6 5 4 3 2 2 2 2 32 32 32 32 32 32 32 23 8 4 4 3 2 2 2 2 32 32 32 19 11 13 14 15 14 4 3 2 2 2 2 2 22 32 12 32 7 7 7 14 6 4 3 2 2 2 2 2 12 9 8 7 5 5 5 17 4 3 3 2 2 2 2 2 32 7 6 5 5 4 4 4 3 3 2 2 2 2 2 1 17 7 5 4 4 4 4 3 3 2 2 2 2 2 2 1 Column 17: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 x = 2 4 A = 4 -3 -2 1 ans = -4 0 ans = 20 -14 -14 10 ans = 25 -11 -11 5 R = -0.84470 -0.74096 -0.47349 0.80606 X = -6 -6 -7 0 7 6 6 -3 -3 0 0 -7 2 1 8 1 2 -7 -7 -2 -2 -7 theta = 0.52360 G = 0.86603 -0.50000 0.50000 0.86603 theta = 30 G = 0.86603 -0.50000 0.50000 0.86603 v = 0.00000 0.25000 0.50000 0.75000 1.00000 A = 8 1 6 3 5 7 4 9 2 A = 8 1 6 3 5 7 4 9 2 Z = 0 0 0 0 0 0 0 0 0 0 0 0 E = 1 1 1 1 1 1 1 1 1 1 1 1 I = Diagonal Matrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 M = 8 1 6 3 5 7 4 9 2 R = 0.347754 0.642243 0.083527 0.229597 0.504715 0.414389 0.531026 0.893007 K = 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 J = 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 v = 0.00000 0.25000 0.50000 0.75000 1.00000 n = 10 y = 1 2 3 4 5 6 7 8 9 10 KJ = 4 8 12 16 8 16 24 32 12 24 36 48 16 32 48 64 JK = 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 ans = 1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16 ans = 0.00000 0.06250 0.25000 0.56250 1.00000 v = 0.00000 0.25000 0.50000 0.75000 1.00000 inner_prod = 1.8750 outer_prod = 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.06250 0.12500 0.18750 0.25000 0.00000 0.12500 0.25000 0.37500 0.50000 0.00000 0.18750 0.37500 0.56250 0.75000 0.00000 0.25000 0.50000 0.75000 1.00000 Z = 1 - 0i 3 - 4i 2 - 0i 5 - 0i Z = 1 + 0i 3 + 4i 2 + 0i 5 + 0i C = { [1,1] = A [1,2] = rolling [1,3] = stone [1,4] = gathers [1,5] = momemtum [1,6] = . } ans = stone ans = { [1,1] = stone } ans = { [1,1] = A [1,2] = rolling [1,3] = stone } ans = A ans = rolling ans = stone ans = { [1,1] = A [1,2] = rolling [1,3] = stone } M = { [1,1] = [1,2] = { [1,1] = E [1,2] = { [1,1] = I [1,2] = { [1,1] = S [1,2] = { [1,1] = H [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = V [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = U [1,2] = { [1,1] = F [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = {}(0x0) } } [1,3] = { [1,1] = A [1,2] = { [1,1] = R [1,2] = { [1,1] = L [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = {}(0x0) } [1,3] = { [1,1] = W [1,2] = { [1,1] = P [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = J [1,2] = {}(0x0) [1,3] = {}(0x0) } } } } [1,3] = { [1,1] = T [1,2] = { [1,1] = N [1,2] = { [1,1] = D [1,2] = { [1,1] = B [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = X [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = K [1,2] = { [1,1] = C [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = Y [1,2] = {}(0x0) [1,3] = {}(0x0) } } } [1,3] = { [1,1] = M [1,2] = { [1,1] = G [1,2] = { [1,1] = Z [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = Q [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = O [1,2] = {}(0x0) [1,3] = {}(0x0) } } } } M = { [1,1] = [1,2] = { [1,1] = E [1,2] = { [1,1] = I [1,2] = { [1,1] = S [1,2] = { [1,1] = H [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = V [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = U [1,2] = { [1,1] = F [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = {}(0x0) } } [1,3] = { [1,1] = A [1,2] = { [1,1] = R [1,2] = { [1,1] = L [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = {}(0x0) } [1,3] = { [1,1] = W [1,2] = { [1,1] = P [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = J [1,2] = {}(0x0) [1,3] = {}(0x0) } } } } [1,3] = { [1,1] = T [1,2] = { [1,1] = N [1,2] = { [1,1] = D [1,2] = { [1,1] = B [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = X [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = K [1,2] = { [1,1] = C [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = Y [1,2] = {}(0x0) [1,3] = {}(0x0) } } } [1,3] = { [1,1] = M [1,2] = { [1,1] = G [1,2] = { [1,1] = Z [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = Q [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = O [1,2] = {}(0x0) [1,3] = {}(0x0) } } } } M = { [1,1] = T [1,2] = { [1,1] = N [1,2] = { [1,1] = D [1,2] = { [1,1] = B [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = X [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = K [1,2] = { [1,1] = C [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = Y [1,2] = {}(0x0) [1,3] = {}(0x0) } } } [1,3] = { [1,1] = M [1,2] = { [1,1] = G [1,2] = { [1,1] = Z [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = Q [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = O [1,2] = {}(0x0) [1,3] = {}(0x0) } } } M = { [1,1] = N [1,2] = { [1,1] = D [1,2] = { [1,1] = B [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = X [1,2] = {}(0x0) [1,3] = {}(0x0) } } [1,3] = { [1,1] = K [1,2] = { [1,1] = C [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = Y [1,2] = {}(0x0) [1,3] = {}(0x0) } } } M = { [1,1] = D [1,2] = { [1,1] = B [1,2] = {}(0x0) [1,3] = {}(0x0) } [1,3] = { [1,1] = X [1,2] = {}(0x0) [1,3] = {}(0x0) } } M = { [1,1] = X [1,2] = {}(0x0) [1,3] = {}(0x0) } E I S H V U F A R L W P J T N D B X K C Y M G Z Q O E T I A N M S U R W D K G O H V F L P J B X C Y Z Q C = !"#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ `abcdefghijklmnopqrstuvwxyz{|}~  ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ t = 0.00000 0.01778 0.04446 0.08447 0.14449 0.23451 0.36955 0.54489 0.75386 0.99697 1.24446 1.46841 1.61987 1.74913 1.89244 2.06379 2.26545 2.49945 2.75092 2.98271 3.14243 3.28844 3.42900 3.59453 3.78965 4.01634 4.27094 4.50875 4.71590 4.88162 5.03193 5.20502 5.40716 5.64133 5.89280 6.12454 6.28319 y = 0.00000 1.00000 0.01778 0.99984 0.04444 0.99901 0.08437 0.99643 0.14398 0.98958 0.23237 0.97262 0.36119 0.93247 0.51830 0.85513 0.68438 0.72894 0.83963 0.54266 0.94684 0.32036 0.99424 0.10206 0.99824 -0.04912 0.98356 -0.17739 0.94813 -0.31604 0.88032 -0.47307 0.76767 -0.63977 0.59831 -0.80025 0.38028 -0.92382 0.15785 -0.98636 -0.00103 -0.99888 -0.14636 -0.98808 -0.28334 -0.95782 -0.43728 -0.89801 -0.60306 -0.79613 -0.76650 -0.64014 -0.90287 -0.42635 -0.97778 -0.20161 -0.99826 0.00382 -0.98393 0.16844 -0.94759 0.31387 -0.87934 0.47237 -0.76654 0.63926 -0.59719 0.79959 -0.37936 0.92290 -0.15721 0.98525 0.00042 0.99768 ode1 is the user-defined function defined from: /home/john/public_html/octave_src/exm/ode1.m function [ t, y ] = ode1 ( F, tspan, y0 ) %*****************************************************************************80 % %% ode1() is the world's simplest ODE solver. % % Discussion: % % ODE1(F,[t0,tfinal],y0) uses Euler's method to solve % dy/dt = F(t,y) % with y(t0) = y0 on the interval t0 <= t <= tfinal. % % Licensing: % % Copyright 2014 The MathWorks, Inc. % % Author: % % Cleve Moler % % Reference: % % Cleve Moler, % Experiments with MATLAB % https://www.mathworks.com/moler % t0 = tspan(1); tfinal = tspan(end); h = ( tfinal - t0 ) / 200; y = y0; for t = t0:h:tfinal ydot = F(t,y); y = y + h * ydot; end return end t = 6.2832 y = 0.032393 1.103746 err = 0.032393 0.103746 n = 6 i = 2 6 3 4 4 5 6 1 1 j = 1 1 2 2 3 3 3 4 6 G = Compressed Column Sparse (rows = 6, cols = 6, nnz = 9 [25%]) (2, 1) -> 1 (6, 1) -> 1 (3, 2) -> 1 (4, 2) -> 1 (4, 3) -> 1 (5, 3) -> 1 (6, 3) -> 1 (1, 4) -> 1 (1, 6) -> 1 j = 1 1 2 2 3 3 3 4 6 x = 0.321017 0.170543 0.106592 0.136793 0.064312 0.200744 x = 0.317744 0.170191 0.106711 0.138335 0.065204 0.201815 x = 0.317744 0.170191 0.106711 0.138335 0.065204 0.201815 x = 0.321017 0.170543 0.106592 0.136793 0.064312 0.200744 X = 8 1 6 0 0 0 0 0 0 3 5 7 0 0 0 0 0 0 4 9 2 0 0 0 0 0 0 0 0 0 8 1 6 0 0 0 0 0 0 3 5 7 0 0 0 0 0 0 4 9 2 0 0 0 0 0 0 0 0 0 8 1 6 0 0 0 0 0 0 3 5 7 0 0 0 0 0 0 4 9 2 C = 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 8 0 0 0 0 1 0 0 0 0 0 0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 0 0 0 0 1 2 9 4 0 0 0 6 1 8 3 0 0 0 0 0 7 5 3 0 0 0 0 2 0 2 9 4 0 0 0 0 0 1 ans = 0 0 3 8 1 6 0 0 0 0 0 0 3 5 7 0 0 0 0 0 0 4 9 2 1 0 0 0 0 0 0 0 3 8 1 6 0 2 0 0 0 0 3 5 7 1 0 0 0 0 0 4 9 2 8 1 6 0 0 0 0 0 3 3 5 7 0 0 0 0 8 0 4 9 2 1 0 0 0 0 0 ans = 6 8 1 0 0 0 0 0 3 7 3 5 0 0 0 0 8 0 2 4 9 1 0 0 0 0 0 3 0 0 8 1 6 0 0 0 0 0 0 3 5 7 0 0 0 0 0 0 4 9 2 1 0 0 0 0 0 0 0 3 8 1 6 0 0 2 0 0 0 3 5 7 0 1 0 0 0 0 4 9 2 C = { [1,1] = [](0x0) [2,1] = [](0x0) [3,1] = [](0x0) [4,1] = 2 5 7 9 [5,1] = 2 6 9 [6,1] = 5 6 7 [7,1] = 5 7 9 [8,1] = 6 9 [9,1] = [](0x0) [1,2] = [](0x0) [2,2] = [](0x0) [3,2] = [](0x0) [4,2] = 4 7 [5,2] = 4 6 8 [6,2] = 6 7 8 [7,2] = 4 7 [8,2] = [](0x0) [9,2] = 3 6 7 8 [1,3] = [](0x0) [2,3] = [](0x0) [3,3] = [](0x0) [4,3] = [](0x0) [5,3] = 1 4 8 9 [6,3] = 5 8 [7,3] = 4 5 9 [8,3] = 4 8 9 [9,3] = 5 8 [1,4] = 2 5 7 9 [2,4] = 2 6 9 [3,4] = [](0x0) [4,4] = [](0x0) [5,4] = [](0x0) [6,4] = [](0x0) [7,4] = 2 5 7 9 [8,4] = 6 9 [9,4] = 5 6 7 [1,5] = 2 4 7 [2,5] = 2 4 6 [3,5] = 3 6 7 8 [4,5] = [](0x0) [5,5] = [](0x0) [6,5] = [](0x0) [7,5] = 2 4 7 [8,5] = 4 6 8 [9,5] = 6 7 8 [1,6] = 4 5 9 [2,6] = 4 9 [3,6] = 5 8 [4,6] = [](0x0) [5,6] = [](0x0) [6,6] = [](0x0) [7,6] = [](0x0) [8,6] = 1 4 8 9 [9,6] = 5 8 [1,7] = 2 5 7 9 [2,7] = 2 6 9 [3,7] = 5 6 7 [4,7] = 2 5 7 9 [5,7] = 2 6 9 [6,7] = [](0x0) [7,7] = [](0x0) [8,7] = [](0x0) [9,7] = [](0x0) [1,8] = 2 4 7 [2,8] = [](0x0) [3,8] = 6 7 [4,8] = 2 4 7 [5,8] = 2 4 6 [6,8] = 3 6 7 [7,8] = [](0x0) [8,8] = [](0x0) [9,8] = [](0x0) [1,9] = [](0x0) [2,9] = 1 4 9 [3,9] = 5 [4,9] = 4 5 9 [5,9] = 4 8 9 [6,9] = 5 8 [7,9] = [](0x0) [8,9] = [](0x0) [9,9] = [](0x0) } N = 0 0 0 4 3 3 4 3 0 0 0 0 3 3 2 3 0 3 0 0 0 0 4 2 3 2 1 4 2 0 0 0 0 4 3 3 3 3 4 0 0 0 3 3 3 3 3 2 0 0 0 0 3 2 3 2 3 4 3 0 0 0 0 2 0 3 2 3 4 0 0 0 0 4 2 3 3 2 0 0 0 s = 75 e = [](0x1) 'sudoku_puzzle' is a function from the file /home/john/public_html/octave_src/exm/sudoku_puzzle.m *****************************************************************************80 sudoku_puzzle() A few Sudoku puzzles. Discussion: X = sudoku_puzzle(p), for scalar p, returns the p-th puzzle. p = 1 MATLAB Special. Incorporates magic square. p = 2 Easy, no backtracking required. p = 3 Slightly difficult, only a few backtracking steps, not unique. p = 4 Four-fold rotational symmetry. Not too difficult. p = 5 Moderately difficult, a few hundred backtracing steps. p = 6 An airline magazine says this is difficult. Is it? p = 7 Solution is not unique. p = 8 Difficult. p = 9 Good example of backtracking. p = 10 Will Shortz says "Beware. Very Challenging." p = 11 Will Shortz says "Beware. Very Challenging." p = 12 Structural symmetry and not too difficult. p = 13 Nice spiral pattern, but there are 346 solutions. p = 14 Structural symmetry. p = 15 Very close to matrix symmetry, and very difficult. p = 16 Structural symmetry and only 17 nonzero initial entries. See also sudoku, sudoku_all, sudoku_assist, sudoku_basic. Licensing: Copyright 2014 The MathWorks, Inc. Author: Cleve Moler Reference: Cleve Moler, Experiments with MATLAB https://www.mathworks.com/moler Additional help for built-in functions and operators is available in the online 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 https://www.octave.org and via the help@octave.org mailing list. ans = 8 1 6 0 0 0 0 0 3 3 5 7 0 0 0 0 8 0 4 9 2 1 0 0 0 0 0 0 0 3 8 1 6 0 0 0 0 0 0 3 5 7 0 0 0 0 0 0 4 9 2 1 0 0 0 0 0 0 0 3 8 1 6 0 2 0 0 0 0 3 5 7 1 0 0 0 0 0 4 9 2 ans = 2 0 7 0 9 1 0 0 4 0 0 0 0 0 0 0 1 2 6 0 0 0 0 2 5 9 0 8 0 5 0 2 3 4 0 0 9 7 0 0 0 0 0 2 6 0 0 1 7 6 0 9 0 8 0 8 6 2 0 0 0 0 3 7 3 0 0 0 0 0 0 0 5 0 0 6 3 0 1 0 9 ans = 0 0 0 9 0 0 3 0 5 0 2 0 0 4 0 0 0 1 3 0 0 0 8 0 9 0 0 0 0 0 0 0 3 0 5 0 0 6 0 4 5 0 8 0 0 0 0 7 8 0 9 0 0 0 0 9 2 6 0 4 0 7 0 6 0 0 0 0 0 0 0 2 5 7 0 0 0 2 0 3 0 ans = 0 0 0 0 8 0 0 0 0 0 0 1 7 0 6 8 0 0 0 6 0 5 0 2 0 3 0 0 4 7 0 0 0 3 1 0 1 0 0 0 0 0 0 0 6 0 8 5 0 0 0 7 2 0 0 3 0 9 0 1 0 4 0 0 0 9 8 0 3 2 0 0 0 0 0 0 5 0 0 0 0 ans = 7 0 1 0 0 0 4 0 0 5 0 0 0 0 0 0 0 0 3 0 0 9 6 0 0 0 0 0 0 0 3 8 0 0 0 5 4 7 0 0 0 0 0 0 6 0 0 0 0 0 9 8 0 2 0 5 0 0 1 8 0 0 0 0 2 4 0 0 0 5 0 0 0 0 0 0 0 3 0 9 0 ans = 0 0 0 1 0 0 0 3 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