demo - Access product demos via Help browser

GUI Alternatives

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

Syntax

demo
demo 'subtopic'
demo 'subtopic category'
demo('subtopic', 'category')

Description

demo opens the Demos pane in the Help browser, listing demos for all installed products that are selected in the Help browser product filter preference. To access demos from the Demos 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 Mathematics). Select a specific demo from the list (for example, Square Wave from Sine Waves). 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. To run an M-file demo, open it in the Editor and run it using Cell > Evaluate Current Cell and Advance, or run echodemo followed by the demo name.

demo 'subtopic' opens the Demos pane in the Help browser with the specified subtopic expanded. Subtopics are matlab, toolbox, simulink, blockset, and links and targets. If no products in subtopic are installed, or if none are selected in the Help browser product filter preference, an error page appears.

demo 'subtopic category' opens the Demos pane in the Help browser to the specified product or category within the subtopic. The demo function uses the full name displayed in the Demo pane for category. If the product specified by category is not installed, or is not selected in the Help browser product filter preference, an error page appears.

demo('subtopic', 'category') is the function form of the syntax.

This illustration shows the result of running

demo matlab graphics

and then selecting the Square Wave from Sine Waves example.

Examples

Accessing Toolbox Demos

To find the demos relating to Communications Toolbox™, product type

demo toolbox communications

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

Accessing Simulink® Demos

To access the demos within the Simulink® product, type

demo simulink automotive

The Demos pane opens with the subtopic for Simulink open and the Automotive category expanded.

Function Form of demo

To access the Simulink® Parameter Estimation™ demos, run

demo('simulink', 'simulink parameter estimation')

which displays

Running a Demo from the Command Line

Type

vibes

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

Running an M-File Demo from the Command Line

Type

quake

to run an earthquake data demo. Not much appears to happen because quake is an M-file demo and executes from start to end without stopping.

It displays a link in the Command Window: View the published version of this demo. Click the link to view and run the demo from the Help browser.

You can view the M-file, quake.m, by typing

edit quake

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

%% Loma Prieta Earthquake

The %% indicates that quake is an M-file demo. You can step through the demo cell-by-cell, from the Editor—select Cell > Evaluate Current Cell and Advance.

Alternatively, run

echodemo quake

and the quake demo runs step-by-step in the Command Window.

See Also

echodemo, grabcode, help, helpbrowser

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS