02-Jul-2023 17:49:18 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 17 49 18.662 Is 2023 a leap year? Answer is false dnum = 739069.74 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.51414 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/m_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 31 47 1.516 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 warning: matrix singular to machine precision warning: called from linear_test at line 28 column 6 exm_test at line 40 column 3 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.15 y = 0.41 0.08 0.15 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/m_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.999774 -0.079373 -0.155816 -0.064500 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.7913706 0.0917800 0.6441463 0.0891172 0.4827989 0.0191654 0.1504942 0.0052457 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{|}~  ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ warning: text_renderer: skipping missing glyph for character '7f' warning: called from text at line 170 column 10 morse_test at line 94 column 8 exm_test at line 44 column 3 warning: text_renderer: skipping missing glyph for character '7f' warning: called from text at line 170 column 10 morse_test at line 94 column 8 exm_test at line 44 column 3 warning: text_renderer: skipping missing glyph for character '7f' warning: called from morse_test at line 95 column 4 exm_test at line 44 column 3 warning: text_renderer: skipping missing glyph for character '7f' warning: called from morse_test at line 95 column 4 exm_test at line 44 column 3 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/m_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 warning: set: allowing toggle to match style value togglebutton warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 222 column 11 orbits at line 48 column 6 orbits_test at line 151 column 4 exm_test at line 52 column 3 warning: set: allowing normal to match units value normalized warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 222 column 11 orbits at line 48 column 6 orbits_test at line 151 column 4 exm_test at line 52 column 3 warning: set: allowing vis to match uicontrol property visible warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 249 column 15 orbits at line 48 column 6 orbits_test at line 151 column 4 exm_test at line 52 column 3 warning: set: allowing normal to match units value normalized warning: called from uicontrol at line 117 column 8 orbits>finalize_graphics at line 350 column 4 orbits at line 81 column 4 orbits_test at line 151 column 4 exm_test at line 52 column 3 warning: set: allowing toggle to match style value togglebutton warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 222 column 11 orbits at line 48 column 6 orbits_test at line 154 column 4 exm_test at line 52 column 3 warning: set: allowing normal to match units value normalized warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 222 column 11 orbits at line 48 column 6 orbits_test at line 154 column 4 exm_test at line 52 column 3 warning: set: allowing vis to match uicontrol property visible warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 249 column 15 orbits at line 48 column 6 orbits_test at line 154 column 4 exm_test at line 52 column 3 warning: set: allowing normal to match units value normalized warning: called from uicontrol at line 117 column 8 orbits>finalize_graphics at line 350 column 4 orbits at line 81 column 4 orbits_test at line 154 column 4 exm_test at line 52 column 3 warning: set: allowing toggle to match style value togglebutton warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 222 column 11 orbits at line 48 column 6 orbits_test at line 157 column 4 exm_test at line 52 column 3 warning: set: allowing normal to match units value normalized warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 222 column 11 orbits at line 48 column 6 orbits_test at line 157 column 4 exm_test at line 52 column 3 warning: set: allowing vis to match uicontrol property visible warning: called from uicontrol at line 117 column 8 orbits>initialize_graphics at line 249 column 15 orbits at line 48 column 6 orbits_test at line 157 column 4 exm_test at line 52 column 3 warning: set: allowing normal to match units value normalized warning: called from uicontrol at line 117 column 8 orbits>finalize_graphics at line 350 column 4 orbits at line 81 column 4 orbits_test at line 157 column 4 exm_test at line 52 column 3 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 warning: matrix singular to machine precision, rcond = 1.14293e-17 warning: called from pagerank_test at line 62 column 6 exm_test at line 53 column 3 x = 0.321017 0.170543 0.106592 0.136793 0.064312 0.200744 k = 1 eta = 1 mu = 20 k = 1 eta = 1 mu = 20 ydot = @(t, y) k * (1 - y / mu) * y mu = 300 200 eta = 400 100 signs = 1 -1 pred_prey_ode = @(t, y) signs .* (1 - flipud (y ./ mu)) .* y period = 6.5357 warning: set: allowing normal to match units value normalized warning: called from predprey>initialize_graphics at line 87 column 7 predprey at line 46 column 10 predprey_test at line 55 column 4 exm_test at line 54 column 3 warning: set: allowing pos to match figure property position warning: called from predprey>initialize_graphics at line 87 column 7 predprey at line 46 column 10 predprey_test at line 55 column 4 exm_test at line 54 column 3 error: handles to nested functions are not yet supported error: called from predprey at line 59 column 9 predprey_test at line 55 column 4 exm_test at line 54 column 3 warning: gh_manager::do_close_all_figures: some graphics elements failed to close.