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