Mercurial > hg > octave-lyh
comparison scripts/testfun/demo.m @ 14327:4d917a6a858b stable
doc: Use Octave coding conventions in @example blocks of docstrings.
* accumarray.m, accumdim.m, bar.m, base2dec.m, bincoeff.m, bitcmp.m, bitset.m,
celldisp.m, chop.m, clabel.m, cloglog.m, colon.m, compass.m, computer.m,
contour3.m, contourc.m, corr.m, cstrcat.m, ctime.m, cylinder.m, date.m,
dec2base.m, demo.m, dir.m, dlmwrite.m, expm.m, ezcontourf.m, ezcontour.m,
ezmeshc.m, ezmesh.m, ezplot.m, ezsurfc.m, ezsurf.m, feather.m, findobj.m,
flipdim.m, fplot.m, genvarname.m, getfield.m, hankel.m, hilb.m, hist.m,
idivide.m, index.m, int2str.m, interp1.m, is_leap_year.m, ismember.m,
isocolors.m, isonormals.m, isosurface.m, kurtosis.m, legendre.m, linkprop.m,
logit.m, logm.m, __makeinfo__.m, __marching_cube__.m, median.m, mkoctfile.m,
moment.m, mpoles.m, orderfields.m, pcg.m, pcr.m, plot3.m, plotmatrix.m,
polyaffine.m, polygcd.m, poly.m, polyout.m, print.m, qp.m, quadgk.m, qzhess.m,
randi.m, rat.m, refreshdata.m, residue.m, rose.m, rot90.m, saveas.m, saveobj.m,
shiftdim.m, skewness.m, spaugment.m, spdiags.m, sqp.m, stem.m, str2num.m,
strcat.m, strjust.m, strread.m, strsplit.m, structfun.m, subplot.m,
subsindex.m, substruct.m, surfl.m, surfnorm.m, svds.m, uimenu.m, union.m,
voronoi.m, warning_ids.m, wblpdf.m: Use Octave coding conventions in
@example blocks of docstrings.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 04 Feb 2012 22:12:50 -0800 |
parents | 72c96de7a403 |
children | ce2b59a6d0e5 |
comparison
equal
deleted
inserted
replaced
14325:a646cee995cf | 14327:4d917a6a858b |
---|---|
32 ## prefix with no intervening spaces. The remainder of the example can | 32 ## prefix with no intervening spaces. The remainder of the example can |
33 ## contain arbitrary Octave code. For example: | 33 ## contain arbitrary Octave code. For example: |
34 ## | 34 ## |
35 ## @example | 35 ## @example |
36 ## @group | 36 ## @group |
37 ## %!demo | 37 ## %!demo |
38 ## %! t=0:0.01:2*pi; x = sin(t); | 38 ## %! t=0:0.01:2*pi; x = sin (t); |
39 ## %! plot (t,x) | 39 ## %! plot (t,x) |
40 ## %! %------------------------------------------------- | 40 ## %! %------------------------------------------------- |
41 ## %! % the figure window shows one cycle of a sine wave | 41 ## %! % the figure window shows one cycle of a sine wave |
42 ## @end group | 42 ## @end group |
43 ## @end example | 43 ## @end example |
44 ## | 44 ## |
45 ## Note that the code is displayed before it is executed, so a simple | 45 ## Note that the code is displayed before it is executed, so a simple |
46 ## comment at the end suffices for labeling what is being shown. It is | 46 ## comment at the end suffices for labeling what is being shown. It is |
50 ## variables. This means that every demo must have separate initialization | 50 ## variables. This means that every demo must have separate initialization |
51 ## code. Alternatively, all demos can be combined into a single large demo | 51 ## code. Alternatively, all demos can be combined into a single large demo |
52 ## with the code | 52 ## with the code |
53 ## | 53 ## |
54 ## @example | 54 ## @example |
55 ## %! input("Press <enter> to continue: ","s"); | 55 ## %! input("Press <enter> to continue: ","s"); |
56 ## @end example | 56 ## @end example |
57 ## | 57 ## |
58 ## @noindent | 58 ## @noindent |
59 ## between the sections, but this is discouraged. Other techniques | 59 ## between the sections, but this is discouraged. Other techniques |
60 ## to avoid multiple initialization blocks include using multiple plots | 60 ## to avoid multiple initialization blocks include using multiple plots |
69 ## multiple lines, you must wrap your demo in "if 1 <demo stuff> endif" | 69 ## multiple lines, you must wrap your demo in "if 1 <demo stuff> endif" |
70 ## with the 'if' on the same line as 'demo'. For example: | 70 ## with the 'if' on the same line as 'demo'. For example: |
71 ## | 71 ## |
72 ## @example | 72 ## @example |
73 ## @group | 73 ## @group |
74 ## %!demo if 1 | 74 ## %!demo if 1 |
75 ## %! function y=f(x) | 75 ## %! function y=f(x) |
76 ## %! y=x; | 76 ## %! y=x; |
77 ## %! endfunction | 77 ## %! endfunction |
78 ## %! f(3) | 78 ## %! f(3) |
79 ## %! endif | 79 ## %! endif |
80 ## @end group | 80 ## @end group |
81 ## @end example | 81 ## @end example |
82 ## | 82 ## |
83 ## @seealso{test, example} | 83 ## @seealso{test, example} |
84 ## @end deftypefn | 84 ## @end deftypefn |