Display Custom Examples
In this section...
“How to Display Examples” on page 30-37
“Elements of the demos.xml File” on page 30-38
How to Display Examples
To display examples such as videos, published program scripts, or other files that
illustrate the use of your programs in the MATLAB help browser, follow these steps:
(^1) Create your example files. Store the files in a folder that is on the MATLAB search
path, but outside the matlabroot folder.
TipMATLAB includes a feature that converts scripts or functions to formatted HTML
files, which you can display as examples. To create these HTML files in MATLAB, use
either of these two methods:
- Create a live script (*.mlx) and export it to HTML. For more information, see
“Share Live Scripts and Functions” on page 19-69. - Create a script (*.m), and publish it to HTML. For more information, see “Publish
and Share MATLAB Code” on page 23-2.
(^2) Create a demos.xml file that describes the name, type, and display information for
your examples.
For example, suppose that you have a toolbox named My Sample, which contains a
script named my_example that you published to HTML. This demos.xml file allows
you to display my_example:
<?xml version="1.0" encoding="utf-8"?>
Display Custom Examples