Navigation

Operators and Keywords

Function List:

C++ API

: example name
: example name n
: example ("name")
: example ("name", n)
: [s, idx] = example (…)

Display the code for example n associated with the function name, but do not run it.

If n is not specified, all examples are displayed.

When called with output arguments, the examples are returned in the form of a string s, with idx indicating the ending position of the various examples.

See demo for a complete explanation.

See also: demo, test.

Demonstration 1

The following code

 example ("example");

Produces the following output

example example 1:
 example ("example");

example example 2:
 clf;
 t = 0:0.01:2*pi;
 x = sin (t);
 plot (t,x)

Demonstration 2

The following code

 clf;
 t = 0:0.01:2*pi;
 x = sin (t);
 plot (t,x)

Produces the following figure

example example 1:
 example ("example");

example example 2:
 clf;
 t = 0:0.01:2*pi;
 x = sin (t);
 plot (t,x)

Figure 1

Package: octave