MATLAB Function Reference Previous page   Next Page
demo

Access product demos via Help browser

Graphical Interface

As an alternative to the demo function, you can select Help -> Demos from the MATLAB desktop, or click the Demos tab when the Help browser is open.

Syntax

Description

demo opens the Demos panel in the Help browser. In the left pane, expand the listing for a product area (for example, MATLAB). Within that product area, expand the listing for a product or product category (for example, MATLAB Graphics). Select a specific demo from the list (for example, Visualizing Sound). In the right pane, view instructions for using the demo. For more information, see the topic Demos in the Help Browser in the MATLAB Desktop Tools and Development Environment documentation. To run a demo from the command line, type the demo name. For published M-file demos, that is those demos in which the H1 line begins with two comment symbols (%%), type playshow followed by the demo name to run it.

demo subtopic opens the Demos panel in the Help browser with the specified subtopic expanded. Subtopics are matlab, toolbox, simulink, and blockset.

demo subtopic category opens the Demos panel in the Help browser to the specified product or category within the subtopic. The demo function uses the full name displayed in the Demo panel for category.

demo('subtopic', 'category') is the function form of the syntax. Use this form when category is more than one word.

Examples

Accessing Toolbox Demos

To find the demos relating to the Communications Toolbox, type

The Help browser opens to the Demos panel with the Toolbox subtopic expanded and with the Communications product highlighted and expanded to show the available demos.

Accessing Simulink Demos

To access the demos within Simulink, type

The Demos panel opens with the Simulink subtopic and Automotive category expanded.

Function Form of demo

To access the Simulink Report Generator demos, run

which displays

Running a Demo from the Command Line

Type

to run a visualization demonstration showing an animated L-shaped membrane.

Running a Published M-File Demo from the Command Line

Type

to run an earthquake data demo. Not much appears to happen. This is because quake is a published M-file demo. Verify this by viewing the M-file, quake.m, for example, by typing

The first line, that is, the H1 line for quake, is

The %% indicates that quake is a published M-file demo. So to run it, type

and the earthquake demo runs.

See Also

grabcode, help, helpbrowser, helpwin, lookfor, playshow


Previous page  delete (timer) depdir Next page

© 1994-2005 The MathWorks, Inc.