]> Creatis software - CreaPhase.git/blob - octave_packages/miscellaneous-1.1.0/doc-cache
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / miscellaneous-1.1.0 / doc-cache
1 # Created by Octave 3.6.1, Mon Apr 02 13:25:55 2012 UTC <root@brouzouf>
2 # name: cache
3 # type: cell
4 # rows: 3
5 # columns: 30
6 # name: <cell-element>
7 # type: sq_string
8 # elements: 1
9 # length: 5
10 apply
11
12
13 # name: <cell-element>
14 # type: sq_string
15 # elements: 1
16 # length: 1709
17  -- Loadable Function: RETURN_VALUE = apply
18           (@FUNCTION_HANDLE,CELL_ARRAY_OF_ARGS)
19  -- Loadable Function: RETURN_VALUE = apply (@FUNCTION_HANDLE)
20      Apply calls the function FUNCTION_HANDLE with the arguments of the
21      cell array CELL_ARRAY_OF_ARGS which contains the actual arguments
22      arg1,arg2,..., argn to the function, in that order. Apply invokes
23      the function as FUNCTION_HANDLE(arg1, arg2, ... ,argn), where the
24      arguments are extracted from each elements of the 1-row cell array
25      CELL_ARRAY_OF_ARGS.
26
27      _warning_: `apply' has been deprecated in favor of `arrayfun' and
28      `cellfun' for arrays and cells respectively. This function will be
29      removed from future versions of the 'miscellaneous' package".
30
31      Apply also works on array of function handles if FUNCTION_HANDLE
32      is passed as a cell array of a handles; in this case apply,
33      evaluates each function (using the handle) with the same arguments.
34
35      The cell-array argument is optional second argument, in the form
36      of a 1-row with multiple elements. The elements of the cell-array
37      form the actual arguments supplied when invoking the  function
38      FUNCTION_HANDLE.
39
40      The return value depends on the function invoked, and the validity
41      of the arguments.
42
43             z=apply(@sqrt,cell([1,2; 3,4]));
44             z=apply(@apply,cell(@sqrt,cell([1,2; 3,4])));
45             apply(@sum,cell([1,2,3,4]))
46             apply(@max,cell([1,2,3,4]))
47             apply(@min,cell([1,2,3,4]))
48
49      In first case, apply computes the sqrt of the matrix [1,2; 3,4];
50      The second example is meta-apply, using apply on itself.  The rest
51      of the examples invoke sum, max, min respectively.
52
53
54
55
56 # name: <cell-element>
57 # type: sq_string
58 # elements: 1
59 # length: 80
60 Apply calls the function FUNCTION_HANDLE with the arguments of the cell
61 array CE
62
63
64
65 # name: <cell-element>
66 # type: sq_string
67 # elements: 1
68 # length: 4
69 asci
70
71
72 # name: <cell-element>
73 # type: sq_string
74 # elements: 1
75 # length: 712
76  -- Function: [STRING] = asci ([COLUMNS])
77      Print ASCI table.
78
79      If this function is called without any input argument and without
80      any output argument then print a nice ASCI-table (excluding
81      special characters with hexcode 0x00 to 0x20) on screen with four
82      columns per default. If this function is called with one output
83      argument then return an ASCI-table string and don't print anything
84      on screen. Finally, if this function is called with one input
85      argument of type scalar then either print (no output argument) or
86      return (one output argument) an ASCI-table with a number of
87      columns given in COLUMNS.
88
89      For example,
90           A = asci (3);
91           disp (A);
92
93
94
95
96 # name: <cell-element>
97 # type: sq_string
98 # elements: 1
99 # length: 17
100 Print ASCI table.
101
102
103
104 # name: <cell-element>
105 # type: sq_string
106 # elements: 1
107 # length: 13
108 chebyshevpoly
109
110
111 # name: <cell-element>
112 # type: sq_string
113 # elements: 1
114 # length: 536
115  -- Function File: COEFS= chebyshevpoly (KIND,ORDER,X)
116      Compute the coefficients of the Chebyshev polynomial, given the
117      ORDER. We calculate the Chebyshev polynomial using the recurrence
118      relations, Tn+1(x) = (2*x*Tn(x) - Tn-1(x)). The KIND can set to
119      compute the first or second kind chebyshev polynomial.
120
121      If the value X is specified, the polynomial is also evaluated,
122      otherwise just the return the coefficients of the polynomial are
123      returned.
124
125      This is NOT the generalized Chebyshev polynomial.
126
127
128
129
130
131 # name: <cell-element>
132 # type: sq_string
133 # elements: 1
134 # length: 70
135 Compute the coefficients of the Chebyshev polynomial, given the ORDER.
136
137
138
139 # name: <cell-element>
140 # type: sq_string
141 # elements: 1
142 # length: 4
143 clip
144
145
146 # name: <cell-element>
147 # type: sq_string
148 # elements: 1
149 # length: 407
150  -- Function File: X = clip (X)
151  -- Function File: X = clip (X, HI)
152  -- Function File: X = clip (X, [LO, HI])
153      Clip X values outside the range.to the value at the boundary of the
154      range.
155
156      Range boundaries, LO and HI, default to 0 and 1 respectively.
157
158      X = clip (X)   Clip to range [0, 1]
159
160      X = clip (X, HI)   Clip to range [0, HI]
161
162      X = clip (X, [LO, HI])   Clip to range [LO, HI]
163
164
165
166
167 # name: <cell-element>
168 # type: sq_string
169 # elements: 1
170 # length: 32
171 Clip X values outside the range.
172
173
174
175 # name: <cell-element>
176 # type: sq_string
177 # elements: 1
178 # length: 10
179 colorboard
180
181
182 # name: <cell-element>
183 # type: sq_string
184 # elements: 1
185 # length: 1540
186  -- Function File: colorboard (M, PALETTE, OPTIONS)
187      Displays a color board corresponding to a numeric matrix M.  M
188      should contain zero-based indices of colors.  The available range
189      of indices is given by the PALETTE argument, which can be one of
190      the following:
191
192         * "b&w"   Black & white, using reverse video mode. This is the
193           default if M is logical.
194
195         * "ansi8"   The standard ANSI 8 color palette. This is the
196           default unless M is logical.
197
198         * "aix16"   The AIXTerm extended 16-color palette. Uses codes
199           100:107 for bright colors.
200
201         * "xterm16"   The first 16 system colors of the Xterm 256-color
202           palette.
203
204         * "xterm216"   The 6x6x6 color cube of the Xterm 256-color
205           palette.    In this case, matrix can also be passed as a
206           MxNx3 RGB array with values 0..5.
207
208         * "grayscale"   The 24 grayscale levels of the Xterm 256-color
209           palette.
210
211         * "xterm256"   The full Xterm 256-color palette. The three
212           above palettes together.
213
214      OPTIONS comprises additional options. The recognized options are:
215
216         * "indent"   The number of spaces by which the board is
217           indented. Default 2.
218
219         * "spaces"   The number of spaces forming one field. Default 2.
220
221         * "horizontalseparator"   The character used for horizontal
222           separation of the table. Default "#".
223
224         * "verticalseparator"   The character used for vertical
225           separation of the table. Default "|".
226
227
228
229
230 # name: <cell-element>
231 # type: sq_string
232 # elements: 1
233 # length: 59
234 Displays a color board corresponding to a numeric matrix M.
235
236
237
238 # name: <cell-element>
239 # type: sq_string
240 # elements: 1
241 # length: 9
242 csv2latex
243
244
245 # name: <cell-element>
246 # type: sq_string
247 # elements: 1
248 # length: 1647
249  Creates a latex file from a csv file. The generated latex file contains a 
250  tabular with all values of the csv file. The tabular can be decorated with 
251  row and column titles. The generated latex file can be inserted in any latex
252  document by using the '\input{latex file name without .tex}' statement.
253
254  Usage: 
255   - csv2latex(csv_file, csv_sep, latex_file)
256   - csv2latex(csv_file, csv_sep, latex_file, tabular_alignments)
257   - csv2latex(csv_file, csv_sep, latex_file, tabular_alignments, has_hline)
258   - csv2latex(csv_file, csv_sep, latex_file,   
259               tabular_alignments, has_hline, column_titles)
260   - csv2latex(csv_file, csv_sep, latex_file, tabular_alignments,
261               has_hline, column_titles, row_titles)
262
263  Parameters:
264   csv_file - the path to an existing csv file
265   csv_sep - the seperator of the csv values
266   latex_file - the path of the latex file to create     
267   tabular_alignments - the tabular alignment preamble (default = {'l','l',...})
268   has_hline - indicates horizontal line seperator (default = false)
269   column_titles - array with the column titles of the tabular (default = {})
270   row_titles - array with the row titles of the tabular (default = {})
271
272  Examples:
273   # creates the latex file 'example.tex' from the csv file 'example.csv' 
274   csv2latex("example.csv", '\t', "example.tex");
275
276   # creates the latex file with horizontal and vertical lines
277   csv2latex('example.csv', '\t', 'example.tex', {'|l|', 'l|'}, true);
278  
279   # creates the latex file with row and column titles
280   csv2latex('example.csv', '\t', 'example.tex', {'|l|', 'l|'}, true, 
281             {'Column 1', 'Column 2', 'Column 3'}, {'Row 1', 'Row 2'});
282
283
284
285 # name: <cell-element>
286 # type: sq_string
287 # elements: 1
288 # length: 38
289  Creates a latex file from a csv file.
290
291
292
293 # name: <cell-element>
294 # type: sq_string
295 # elements: 1
296 # length: 10
297 gameoflife
298
299
300 # name: <cell-element>
301 # type: sq_string
302 # elements: 1
303 # length: 333
304  -- Function File: B = gameoflife (A, ngen, delay)
305      Runs the Conways' game of life from a given initial state for a
306      given number of generations and visualizes the process.  If ngen
307      is infinity, the process is run as long as A changes.  Delay sets
308      the pause between two frames. If zero, visualization is not done.
309
310
311
312
313 # name: <cell-element>
314 # type: sq_string
315 # elements: 1
316 # length: 80
317 Runs the Conways' game of life from a given initial state for a given
318 number of 
319
320
321
322 # name: <cell-element>
323 # type: sq_string
324 # elements: 1
325 # length: 11
326 hermitepoly
327
328
329 # name: <cell-element>
330 # type: sq_string
331 # elements: 1
332 # length: 352
333  -- Function File: COEFS= hermitepoly (ORDER,X)
334      Compute the coefficients of the Hermite polynomial, given the
335      ORDER. We calculate the Hermite polynomial using the recurrence
336      relations, Hn+1(x) = 2x.Hn(x) - 2nHn-1(x).
337
338      If the value X is specified, the polynomial is also evaluated,
339      otherwise just the return the coefficients.
340
341
342
343
344
345 # name: <cell-element>
346 # type: sq_string
347 # elements: 1
348 # length: 68
349 Compute the coefficients of the Hermite polynomial, given the ORDER.
350
351
352
353 # name: <cell-element>
354 # type: sq_string
355 # elements: 1
356 # length: 13
357 hilbert_curve
358
359
360 # name: <cell-element>
361 # type: sq_string
362 # elements: 1
363 # length: 322
364  -- Function file: X, Y hilbert_curve (N)
365      Creates an iteration of the Hilbert space-filling curve with N
366      points.  The argument N must be of the form `2^M', where M is an
367      integer greater than 0.
368
369           n = 8
370           [x ,y] = hilbert_curve (n);
371           line (x, y, "linewidth", 4, "color", "blue");
372
373
374
375
376
377 # name: <cell-element>
378 # type: sq_string
379 # elements: 1
380 # length: 70
381 Creates an iteration of the Hilbert space-filling curve with N points.
382
383
384
385 # name: <cell-element>
386 # type: sq_string
387 # elements: 1
388 # length: 12
389 infoskeleton
390
391
392 # name: <cell-element>
393 # type: sq_string
394 # elements: 1
395 # length: 330
396  -- Function File: infoskeleton (PROTOTYPE, INDEX_STR, SEE_ALSO)
397      Generate TeXinfo skeleton documentation of PROTOTYPE.
398
399      Optionally INDEX_STR and SEE_ALSO can be specified.
400
401      Usage of this function is typically,
402           infoskeleton('[V,Q] = eig( A )','linear algebra','eigs, chol, qr, det')
403
404      See also: info
405
406
407
408
409
410 # name: <cell-element>
411 # type: sq_string
412 # elements: 1
413 # length: 53
414 Generate TeXinfo skeleton documentation of PROTOTYPE.
415
416
417
418 # name: <cell-element>
419 # type: sq_string
420 # elements: 1
421 # length: 12
422 laguerrepoly
423
424
425 # name: <cell-element>
426 # type: sq_string
427 # elements: 1
428 # length: 461
429  -- Function File: COEFS= laguerrepoly (ORDER,X)
430      Compute the coefficients of the Laguerre polynomial, given the
431      ORDER. We calculate the Laguerre polynomial using the recurrence
432      relations, Ln+1(x) = inv(n+1)*((2n+1-x)Ln(x) - nLn-1(x)).
433
434      If the value X is specified, the polynomial is also evaluated,
435      otherwise just the return the coefficients of the polynomial are
436      returned.
437
438      This is NOT the generalized Laguerre polynomial.
439
440
441
442
443
444 # name: <cell-element>
445 # type: sq_string
446 # elements: 1
447 # length: 69
448 Compute the coefficients of the Laguerre polynomial, given the ORDER.
449
450
451
452 # name: <cell-element>
453 # type: sq_string
454 # elements: 1
455 # length: 7
456 lauchli
457
458
459 # name: <cell-element>
460 # type: sq_string
461 # elements: 1
462 # length: 417
463  -- Function File: A = lauchli (N)
464  -- Function File: A = lauchli (N,MU)
465      Creates the matrix [ ones(1,N); MU*eye(N) ] The value MU defaults
466      to sqrt(eps).  This is an ill-conditioned system for testing the
467      accuracy of the QR routine.
468
469                 A = lauchli(15);
470                 [Q, R] = qr(A);
471                 norm(Q*R - A)
472                 norm(Q'*Q - eye(rows(Q)))
473
474    See also: ones, zeros, eye
475
476
477
478
479 # name: <cell-element>
480 # type: sq_string
481 # elements: 1
482 # length: 79
483 Creates the matrix [ ones(1,N); MU*eye(N) ] The value MU defaults to
484 sqrt(eps).
485
486
487
488 # name: <cell-element>
489 # type: sq_string
490 # elements: 1
491 # length: 12
492 legendrepoly
493
494
495 # name: <cell-element>
496 # type: sq_string
497 # elements: 1
498 # length: 462
499  -- Function File: COEFS= legendrepoly (ORDER,X)
500      Compute the coefficients of the Legendre polynomial, given the
501      ORDER. We calculate the Legendre polynomial using the recurrence
502      relations, Pn+1(x) = inv(n+1)*((2n+1)*x*Pn(x) - nPn-1(x)).
503
504      If the value X is specified, the polynomial is also evaluated,
505      otherwise just the return the coefficients of the polynomial are
506      returned.
507
508      This is NOT the generalized Legendre polynomial.
509
510
511
512
513
514 # name: <cell-element>
515 # type: sq_string
516 # elements: 1
517 # length: 69
518 Compute the coefficients of the Legendre polynomial, given the ORDER.
519
520
521
522 # name: <cell-element>
523 # type: sq_string
524 # elements: 1
525 # length: 3
526 map
527
528
529 # name: <cell-element>
530 # type: sq_string
531 # elements: 1
532 # length: 1227
533  -- Function File: RESULT = map (FUNCTION, ITERABLE, ...)
534      Apply FUNCTION to every item of ITERABLE and return the results.
535
536      `map', like Lisp's ( & numerous other language's ) function for
537      iterating the result of a function applied to each of the data
538      structure's elements in turn. The results are stored in the
539      corresponding input's place. For now, just will work with cells and
540      matrices, but support for structs are intended for future versions.
541      Also, only "prefix" functions ( like `min (a, b, c, ...)' ) are
542      supported. FUN_HANDLE can either be a function name string or a
543      function handle (recommended).
544
545      Example:
546
547           octave> A
548           A
549           {
550             [1,1] = 0.0096243
551             [2,1] = 0.82781
552             [1,2] = 0.052571
553             [2,2] = 0.84645
554           }
555           octave> B
556           B =
557           {
558             [1,1] = 0.75563
559             [2,1] = 0.84858
560             [1,2] = 0.16765
561             [2,2] = 0.85477
562           }
563           octave> map(@min,A,B)
564           ans =
565           {
566             [1,1] = 0.0096243
567             [2,1] = 0.82781
568             [1,2] = 0.052571
569             [2,2] = 0.84645
570           }
571
572      See also: reduce, match
573
574
575
576
577
578 # name: <cell-element>
579 # type: sq_string
580 # elements: 1
581 # length: 64
582 Apply FUNCTION to every item of ITERABLE and return the results.
583
584
585
586 # name: <cell-element>
587 # type: sq_string
588 # elements: 1
589 # length: 5
590 match
591
592
593 # name: <cell-element>
594 # type: sq_string
595 # elements: 1
596 # length: 1002
597  -- Function File: RESULT =  match ( FUN_HANDLE, ITERABLE )
598      match is filter, like Lisp's ( & numerous other language's )
599      function for Python has a built-in filter function which takes two
600      arguments, a function and a list, and returns a list. 'match'
601      performs the same operation like filter in Python. The match
602      applies the function to each of the element in the ITERABLE and
603      collects that the result of a function applied to each of the data
604      structure's elements in turn, and the return values are collected
605      as a list of input arguments, whenever the function-result is
606      'true' in Octave sense. Anything (1,true,?) evaluating to true,
607      the argument is saved into the return value.
608
609      FUN_HANDLE can either be a function name string or a function
610      handle (recommended).
611
612      Typically you can use it as,
613           match(@(x) ( x >= 1 ), [-1 0 1 2])
614                 =>   1   2
615
616      See also: reduce, cellfun, arrayfun, cellfun, structfun, spfun
617
618
619
620
621
622 # name: <cell-element>
623 # type: sq_string
624 # elements: 1
625 # length: 80
626 match is filter, like Lisp's ( & numerous other language's ) function
627 for Python
628
629
630
631 # name: <cell-element>
632 # type: sq_string
633 # elements: 1
634 # length: 5
635 normc
636
637
638 # name: <cell-element>
639 # type: sq_string
640 # elements: 1
641 # length: 269
642  -- Function File: X = normc (M)
643      Normalize the columns of a matrix to a length of 1 and return the
644      matrix.
645
646             M=[1,2; 3,4];
647             normc(M)
648
649             ans =
650
651             0.31623   0.44721
652             0.94868   0.89443
653
654      See also: normr
655
656
657
658
659
660 # name: <cell-element>
661 # type: sq_string
662 # elements: 1
663 # length: 73
664 Normalize the columns of a matrix to a length of 1 and return the
665 matrix.
666
667
668
669 # name: <cell-element>
670 # type: sq_string
671 # elements: 1
672 # length: 5
673 normr
674
675
676 # name: <cell-element>
677 # type: sq_string
678 # elements: 1
679 # length: 267
680  -- Function File: X =  normr (M)
681      Normalize the rows of a matrix to a length of 1 and return the
682      matrix.
683
684             M=[1,2; 3,4];
685             normr(M)
686
687             ans =
688
689             0.44721   0.89443
690             0.60000   0.80000
691
692      See also: normc
693
694
695
696
697
698 # name: <cell-element>
699 # type: sq_string
700 # elements: 1
701 # length: 70
702 Normalize the rows of a matrix to a length of 1 and return the matrix.
703
704
705
706 # name: <cell-element>
707 # type: sq_string
708 # elements: 1
709 # length: 3
710 nze
711
712
713 # name: <cell-element>
714 # type: sq_string
715 # elements: 1
716 # length: 147
717  -- Function File: [Y, F] =  nze (X)
718      Extract nonzero elements of X. Equivalent to `X(X != 0)'.
719      Optionally, returns also linear indices.
720
721
722
723
724 # name: <cell-element>
725 # type: sq_string
726 # elements: 1
727 # length: 30
728 Extract nonzero elements of X.
729
730
731
732 # name: <cell-element>
733 # type: sq_string
734 # elements: 1
735 # length: 11
736 peano_curve
737
738
739 # name: <cell-element>
740 # type: sq_string
741 # elements: 1
742 # length: 316
743  -- Function file: X, Y peano_curve (N)
744      Creates an iteration of the Peano space-filling curve with N
745      points.  The argument N must be of the form `3^M', where M is an
746      integer greater than 0.
747
748           n = 9;
749           [x, y] = peano_curve (n);
750           line (x, y, "linewidth", 4, "color", "red");
751
752
753
754
755
756 # name: <cell-element>
757 # type: sq_string
758 # elements: 1
759 # length: 68
760 Creates an iteration of the Peano space-filling curve with N points.
761
762
763
764 # name: <cell-element>
765 # type: sq_string
766 # elements: 1
767 # length: 7
768 publish
769
770
771 # name: <cell-element>
772 # type: sq_string
773 # elements: 1
774 # length: 1772
775  -- Function File:  publish (FILENAME)
776  -- Function File:  publish (FILENAME, OPTIONS)
777      Produces latex reports from scripts.
778
779           publish (MY_SCRIPT)
780
781      where the argument is a string that contains the file name of the
782      script we want to report.
783
784      If two arguments are given, they are interpreted as follows.
785
786           publish (FILENAME, [OPTION, VALUE, ...])
787
788      The following options are available:
789
790         * format
791
792           the only available format values are the strings `latex' and
793           `html'.
794
795         * imageFormat:
796
797           string that specifies the image format, valid formats are
798           `pdf', `png', and `jpg'(or `jpeg').
799
800         * showCode:
801
802           boolean value that specifies if the source code will be
803           included in the report.
804
805         * evalCode:
806
807           boolean value that specifies if execution results will be
808           included in the report.
809
810
811      Default OPTIONS
812
813         * format = latex
814
815         * imageFormat = pdf
816
817         * showCode =  1
818
819         * evalCode =  1
820
821
822      Remarks
823
824         * Any additional non-valid field is removed without
825           notification.
826
827         * To include several figures in the resulting report you must
828           use figure with a unique number for each one of them.
829
830         * You do not have to save the figures manually, publish will do
831           it for you.
832
833         * The functions works only for the current path and no way ...
834           to specify other path is allowed.
835
836
837      Assume you have the script `myscript.m' which looks like
838
839           x = 0:0.1:pi;
840           y = sin(x)
841           figure(1)
842           plot(x,y);
843           figure(2)
844           plot(x,y.^2);
845
846      You can then call publish with default OPTIONS
847
848           publish("myscript")
849
850
851
852
853 # name: <cell-element>
854 # type: sq_string
855 # elements: 1
856 # length: 36
857 Produces latex reports from scripts.
858
859
860
861 # name: <cell-element>
862 # type: sq_string
863 # elements: 1
864 # length: 12
865 read_options
866
867
868 # name: <cell-element>
869 # type: sq_string
870 # elements: 1
871 # length: 1910
872  -- Function File: [OP,NREAD] =  read_options ( args, varargin )
873      The function read_options parses arguments to a function as,
874      [ops,nread] = read_options (args,...) - Read options
875
876      The input being ARGS a list of options and values.  The options
877      can be any of the following,
878
879      'op0'    , string : Space-separated names of opt taking no
880      argument  <">
881
882      'op1'    , string : Space-separated names of opt taking one
883      argument <">
884
885      'extra'  , string : Name of nameless trailing arguments.
886       <">
887
888      'default', struct : Struct holding default option values
889      <none>
890
891      'prefix' , int    : If false, only accept whole opt names.
892      Otherwise, <0>                     recognize opt from first chars,
893      and choose                     shortest if many opts start alike.
894
895      'nocase' , int    : If set, ignore case in option names
896        <0>
897
898      'quiet'  , int    : Behavior when a non-string or unknown opt is
899      met  <0>              0    - Produce an error              1    -
900      Return quietly (can be diagnosed by checking 'nread')
901
902      'skipnan', int    : Ignore NaNs if there is a default value.
903      Note : At least one of 'op0' or 'op1' should be specified.
904
905      The output variables are, OPS      : struct : Struct whose
906      key/values are option names/values NREAD    : int    : Number of
907      elements of args that were read
908
909      USAGE
910           # Define options and defaults
911           op0 = "is_man is_plane flies"
912           default = struct ("is_man",1, "flies",0);
913
914                                        # Read the options
915
916           s = read_options (list (all_va_args), "op0",op0,"default",default)
917
918                                        # Create variables w/ same name as options
919
920           [is_man, is_plane, flies] = getfields (s,"is_man", "is_plane", "flies")
921           pre 2.1.39 function [op,nread] = read_options (args, ...)
922
923
924
925
926 # name: <cell-element>
927 # type: sq_string
928 # elements: 1
929 # length: 80
930 The function read_options parses arguments to a function as,
931 [ops,nread] = read_
932
933
934
935 # name: <cell-element>
936 # type: sq_string
937 # elements: 1
938 # length: 6
939 reduce
940
941
942 # name: <cell-element>
943 # type: sq_string
944 # elements: 1
945 # length: 938
946  -- Function File: X = reduce (FUNCTION, SEQUENCE,INITIALIZER)
947  -- Function File: X = reduce (FUNCTION, SEQUENCE)
948      Implements the 'reduce' operator like in Lisp, or Python.  Apply
949      function of two arguments cumulatively to the items of sequence,
950      from left to right, so as to reduce the sequence to a single
951      value. For example, reduce(@(x,y)(x+y), [1, 2, 3, 4, 5])
952      calculates ((((1+2)+3)+4)+5).  The left argument, x, is the
953      accumulated value and the right argument, y, is the update value
954      from the sequence. If the optional initializer is present, it is
955      placed before the items of the sequence in the calculation, and
956      serves as a default when the sequence is empty. If initializer is
957      not given and sequence contains only one item, the first item is
958      returned.
959
960            reduce(@add,[1:10])
961            => 55
962                reduce(@(x,y)(x*y),[1:7])
963            => 5040  (actually, 7!)
964
965
966
967
968 # name: <cell-element>
969 # type: sq_string
970 # elements: 1
971 # length: 57
972 Implements the 'reduce' operator like in Lisp, or Python.
973
974
975
976 # name: <cell-element>
977 # type: sq_string
978 # elements: 1
979 # length: 9
980 rolldices
981
982
983 # name: <cell-element>
984 # type: sq_string
985 # elements: 1
986 # length: 373
987  -- Function File: rolldices (N)
988  -- Function File: rolldices (N, NREP, DELAY)
989      Returns N random numbers from the 1:6 range, displaying a visual
990      selection effect.
991
992      NREP sets the number of rolls, DELAY specifies time between
993      successive rolls in seconds. Default is nrep = 25 and delay = 0.1.
994
995      Requires a terminal with ANSI escape sequences enabled.
996
997
998
999
1000 # name: <cell-element>
1001 # type: sq_string
1002 # elements: 1
1003 # length: 80
1004 Returns N random numbers from the 1:6 range, displaying a visual
1005 selection effec
1006
1007
1008
1009 # name: <cell-element>
1010 # type: sq_string
1011 # elements: 1
1012 # length: 10
1013 slurp_file
1014
1015
1016 # name: <cell-element>
1017 # type: sq_string
1018 # elements: 1
1019 # length: 293
1020  -- Function File: S =  slurp_file ( f )
1021      slurp_file return a whole text file F as a string S.
1022
1023      F : string : filename S : string : contents of the file
1024
1025      If F is not an absolute filename, and is not an immediately
1026      accessible file, slurp_file () will look for F in the path.
1027
1028
1029
1030
1031 # name: <cell-element>
1032 # type: sq_string
1033 # elements: 1
1034 # length: 52
1035 slurp_file return a whole text file F as a string S.
1036
1037
1038
1039 # name: <cell-element>
1040 # type: sq_string
1041 # elements: 1
1042 # length: 11
1043 solvesudoku
1044
1045
1046 # name: <cell-element>
1047 # type: sq_string
1048 # elements: 1
1049 # length: 313
1050  -- Function File: [ X, NTRIAL] = solvesudoku (S)
1051      Solves a classical 9x9 sudoku. S should be a 9x9 array with
1052      numbers from 0:9. 0 indicates empty field.  Returns the filled
1053      table or empty matrix if no solution exists.  If requested, NTRIAL
1054      returns the number of trial-and-error steps needed.
1055
1056
1057
1058
1059 # name: <cell-element>
1060 # type: sq_string
1061 # elements: 1
1062 # length: 30
1063 Solves a classical 9x9 sudoku.
1064
1065
1066
1067 # name: <cell-element>
1068 # type: sq_string
1069 # elements: 1
1070 # length: 9
1071 temp_name
1072
1073
1074 # name: <cell-element>
1075 # type: sq_string
1076 # elements: 1
1077 # length: 504
1078  -- Function File: N =  temp_name ( rootname, quick )
1079      name = temp_name(rootname, quick=1) - Return a name that is not
1080      used
1081
1082      Returns a name, suitable for defining a new function, script or
1083      global variable, of the form
1084
1085      [rootname,number]
1086
1087      Default rootname is "temp_name_"
1088
1089      "quick" is an optional parameter, which defaults to 1. If it is
1090      false, temp_name() will find the smallest acceptable number for
1091      the name.  Otherwise, a hopefully quicker method is used.
1092
1093
1094
1095
1096
1097 # name: <cell-element>
1098 # type: sq_string
1099 # elements: 1
1100 # length: 69
1101 name = temp_name(rootname, quick=1) - Return a name that is not used
1102
1103
1104
1105
1106 # name: <cell-element>
1107 # type: sq_string
1108 # elements: 1
1109 # length: 5
1110 units
1111
1112
1113 # name: <cell-element>
1114 # type: sq_string
1115 # elements: 1
1116 # length: 804
1117  -- Function File:  units (FROMUNIT, TOUNIT)
1118  -- Function File:  units (FROMUNIT, TOUNIT, X)
1119      Return the conversion factor from FROMUNIT to TOUNIT measurements.
1120
1121      This is an octave interface to the *GNU Units* program which comes
1122      with an annotated, extendable database defining over two thousand
1123      measurement units.  See `man units' or
1124      `http://www.gnu.org/software/units' for more information.  If the
1125      optional argument X is supplied, return that argument multiplied
1126      by the conversion factor.  Nonlinear conversions such as
1127      Fahrenheit to Celsius are not currently supported.  For example, to
1128      convert three values from miles per hour into meters per second:
1129
1130           units ("mile/hr", "m/sec", [30, 55, 75])
1131           ans =
1132
1133             13.411  24.587  33.528
1134
1135
1136
1137
1138 # name: <cell-element>
1139 # type: sq_string
1140 # elements: 1
1141 # length: 66
1142 Return the conversion factor from FROMUNIT to TOUNIT measurements.
1143
1144
1145
1146 # name: <cell-element>
1147 # type: sq_string
1148 # elements: 1
1149 # length: 7
1150 z_curve
1151
1152
1153 # name: <cell-element>
1154 # type: sq_string
1155 # elements: 1
1156 # length: 310
1157  -- Function file: X, Y z_curve (N)
1158      Creates an iteration of the Z-order space-filling curve with N
1159      points.  The argument N must be of the form `2^M', where M is an
1160      integer greater than 0.
1161
1162           n = 8
1163           [x ,y] = z_curve (n);
1164           line (x, y, "linewidth", 4, "color", "blue");
1165
1166
1167
1168
1169
1170 # name: <cell-element>
1171 # type: sq_string
1172 # elements: 1
1173 # length: 70
1174 Creates an iteration of the Z-order space-filling curve with N points.
1175
1176
1177
1178 # name: <cell-element>
1179 # type: sq_string
1180 # elements: 1
1181 # length: 6
1182 zagzig
1183
1184
1185 # name: <cell-element>
1186 # type: sq_string
1187 # elements: 1
1188 # length: 627
1189  -- Function File:  zagzig (MTRX)
1190      Returns zagzig walk-off of the elements of MTRX.  Essentially it
1191      walks the matrix in a Z-fashion.
1192
1193      mat =   1   4   7   2   5   8   3   6   9 then zagzag(mat) gives
1194      the output, [1 4 2 3 5 7 8 6 9], by walking as shown in the figure
1195      from pt 1 in that order of output.  The argument MTRX should be a
1196      MxN matrix. One use of zagzig the use with picking up DCT
1197      coefficients like in the JPEG algorithm for compression.
1198
1199      An example of zagzig use:
1200           mat = reshape(1:9,3,3);
1201           zagzag(mat)
1202           ans =[1 4 2 3 5 7 8 6 9]
1203
1204
1205    See also: zigzag
1206
1207
1208
1209
1210 # name: <cell-element>
1211 # type: sq_string
1212 # elements: 1
1213 # length: 48
1214 Returns zagzig walk-off of the elements of MTRX.
1215
1216
1217
1218 # name: <cell-element>
1219 # type: sq_string
1220 # elements: 1
1221 # length: 6
1222 zigzag
1223
1224
1225 # name: <cell-element>
1226 # type: sq_string
1227 # elements: 1
1228 # length: 550
1229  -- Function File:  zigzag (MTRX)
1230      Returns zigzag walk-off of the elements of MTRX.  Essentially it
1231      walks the matrix in a Z-fashion.
1232
1233      mat =   1   4   7   2   5   8   3   6   9 then zigzag(mat) gives
1234      the output, [1   2   4   7   5   3   6   8   9], by walking as
1235      shown in the figure from pt 1 in that order of output.  The
1236      argument MTRX should be a MxN matrix
1237
1238      An example of zagzig use:
1239           mat = reshape(1:9,3,3);
1240           zigzag(mat)
1241           ans =[1   2   4   7   5   3   6   8   9]
1242
1243
1244    See also: zagzig
1245
1246
1247
1248
1249 # name: <cell-element>
1250 # type: sq_string
1251 # elements: 1
1252 # length: 48
1253 Returns zigzag walk-off of the elements of MTRX.
1254
1255
1256
1257
1258