Mercurial > hg > octave-avbm
changeset 3683:505f5c35a2c9
[project @ 2000-06-27 20:19:47 by jwe]
author | jwe |
---|---|
date | Tue, 27 Jun 2000 20:20:46 +0000 |
parents | 19e1ac7359fb |
children | f5f010fdbba5 |
files | doc/interpreter/io.txi scripts/ChangeLog scripts/io/disp.m scripts/io/fdisp.m scripts/plot/plot.m src/ChangeLog src/DLD-FUNCTIONS/gammainc.cc src/pr-output.cc |
diffstat | 8 files changed, 119 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/io.txi +++ b/doc/interpreter/io.txi @@ -85,6 +85,8 @@ @DOCSTRING(ans) +@DOCSTRING(fdisp) + @DOCSTRING(disp) @DOCSTRING(format)
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,11 @@ +2000-06-27 John W. Eaton <jwe@bevo.che.wisc.edu> + + * io/fdisp.m, io/disp.m: New files. + +2000-06-27 Matthew W. Roberts <matt@lehi.tamu.edu> + + * plot/plot.m: Add examples in doc string. + 2000-06-08 Ben Sapp <bsapp@nua.lampf.lanl.gov> * control/base/__stepimp__.m: Reset multiplot state when done.
new file mode 100644 --- /dev/null +++ b/scripts/io/disp.m @@ -0,0 +1,36 @@ +## Copyright (C) 2000 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, write to the Free +## Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## -*- texinfo -*- +## @deftypefn {Function File} {} disp (@var{x}) +## Display the value of @var{x} on the standard output stream. +## @end deftypefn +## @seealso{fdisp} + +## Author: jwe + +function disp (x) + + if (nargin == 1) + fdisp (stdout, x) + else + usage ("disp (x)"); + endif + +endfunction
new file mode 100644 --- /dev/null +++ b/scripts/io/fdisp.m @@ -0,0 +1,46 @@ +## Copyright (C) 2000 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, write to the Free +## Software Foundation, 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## -*- texinfo -*- +## @deftypefn {Function File} {} fdisp (@var{fid}, @var{x}) +## Display the value of @var{x} on file id @var{fid}. For example, +## +## @example +## fdisp (stdout, "The value of pi is:"), fdisp (stdout, pi) +## +## @print{} the value of pi is: +## @print{} 3.1416 +## @end example +## +## @noindent +## Note that the output from @code{fdisp} always ends with a newline. +## @end deftypefn +## @seealso{disp} + +## Author: jwe + +function fdisp (fid, x) + + if (nargin == 2) + fid << x << "\n"; + else + usage ("fdisp (fid, x)"); + endif + +endfunction
--- a/scripts/plot/plot.m +++ b/scripts/plot/plot.m @@ -138,6 +138,12 @@ ## 6 brown there exists ## @end example ## +## The @var{fmt} argument can also be used to assign key titles. +## To do so, include the desired title between semi-colons after the +## formatting sequence described above, e.g. "+3;Key Title;" +## Note that the last semi-colon is required and will generate an error if +## it is left out. +## ## Here are some plot examples: ## ## @example @@ -154,6 +160,14 @@ ## ## This command will plot the data in the variable @code{b} will be plotted ## with points displayed as @samp{*}. +## +## @example +## t = 0:0.1:6.3; +## plot (t, cos(t), "-;cos(t);", t, sin(t), "+3;sin(t);"); +## @end example +## +## This will plot the cosine and sine functions and label them accordingly +## in the key. ## @end deftypefn ## @seealso{semilogx, semilogy, loglog, polar, mesh, contour, __pltopt__ ## bar, stairs, gplot, gsplot, replot, xlabel, ylabel, and title}
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2000-06-27 John W. Eaton <jwe@bevo.che.wisc.edu> + + * pr-output.cc (Fdisp): Delete. + 2000-06-26 John W. Eaton <jwe@bevo.che.wisc.edu> * pr-output.cc (float_format::float_format): Set default values
--- a/src/DLD-FUNCTIONS/gammainc.cc +++ b/src/DLD-FUNCTIONS/gammainc.cc @@ -39,26 +39,26 @@ @iftex\n\ @tex\n\ $$\n\ - \\gamma (a, x) = {\\displaystyle\\int_0^x e^{-t} t^{a-1} dt \\over \\Gamma (a)}\n\ + \\gamma (x, a) = {\\displaystyle\\int_0^x e^{-t} t^{a-1} dt \\over \\Gamma (a)}\n\ $$\n\ @end tex\n\ @end iftex\n\ @ifinfo\n\ \n\ @smallexample\n\ - x\n\ - 1 /\n\ -gammainc (a, x) = --------- | exp (-t) t^(a-1) dt\n\ - gamma (a) /\n\ - t=0\n\ + x\n\ + 1 /\n\ +gammainc (x, a) = --------- | exp (-t) t^(a-1) dt\n\ + gamma (a) /\n\ + t=0\n\ @end smallexample\n\ @end ifinfo\n\ \n\ -If @var{a} is scalar, then @code{gammainc (@var{a}, @var{x})} is returned\n\ +If @var{a} is scalar, then @code{gammainc (@var{x}, @var{a})} is returned\n\ for each element of @var{x} and vice versa.\n\ \n\ -If neither @var{a} nor @var{x} is scalar, the sizes of @var{a} and\n\ -@var{x} must agree, and @var{gammainc} is applied element-by-element.\n\ +If neither @var{x} nor @var{a} is scalar, the sizes of @var{x} and\n\ +@var{a} must agree, and @var{gammainc} is applied element-by-element.\n\ @end deftypefn\n\ @seealso{gamma and lgamma}") {
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -1751,34 +1751,6 @@ } } -DEFUN (disp, args, , - "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} disp (@var{x})\n\ -Display the value of @var{x}. For example,\n\ -\n\ -@example\n\ -disp (\"The value of pi is:\"), disp (pi)\n\ -\n\ - @print{} the value of pi is:\n\ - @print{} 3.1416\n\ -@end example\n\ -\n\ -@noindent\n\ -Note that the output from @code{disp} always ends with a newline.\n\ -@end deftypefn") -{ - octave_value_list retval; - - int nargin = args.length (); - - if (nargin == 1) - args(0).print (octave_stdout); - else - print_usage ("disp"); - - return retval; -} - static void init_format_state (void) {