# demoplt

There are 37 demo and application programs included in this toolbox distributed between the demo, sig, and math folders. All of these programs can help you learn how to take advantage of most of plt's features. Also included in the demo folder is demoplt.m, a program that makes it easy to start any of these 37 programs by clicking on the button with the name of the program. But more often, demoplt is used as your first introduction to this toolbox in which case you will want to run all of these programs in sequence by clicking the "All Programs" button.
This is the figure you will see after typing demoplt in the command window.

• | The top three rows of buttons (green) are the programs in the demo folder and are designed primarily to demonstrate particular features of the plt plotting routine. The first program in this list plt5 is the simplest example and demonstrates plt's most basic features.
• | The next row of buttons (yellow) are the signal processing applications that are located in the sig folder.
• | The remaining buttons (purple) start the programs in the math folder which are designed to illustrate a mathematical or engineering oriented topic.

I recommend running through the All Demos sequence at least once after installing this toolbox. This will verify that the toolbox was installed properly. I know most users don't do this because I get many questions of the form "can plt do xxxxx?" but they would have easily seen that the answer was "yes" if they had seen the one of figure windows that appears during the All Demos sequence.
As each demo is run, you may peruse the code for the demo program currently being run by using the scrollbar on the right side of the list box. Note that the number of lines of code (not counting the comment lines) appears in the lower right corner of the figure to give you an idea of the complexity of each example. If the text is too big or small for your taste, adjust the font size using the fontsize popup menu in the lower right corner of the demoplt figure. This font size is saved (in init\demoplt.mat) along with the current figure colors and screen location so that the figure will look the same the next time demoplt is started.
Clicking on the small help button to the right of the All Programs button brings up the plt help file. On Windows-based systems this is done using the windows 'hh.exe' utility to read the plt.chm help file. For other operating systems, the default browser is started to view the plt documentation.
When you click on the "All Programs" button, the first demo program appears (plt5.m) and the All Programs button changes to a continue button. In addition, this figure appears above the plt5 window to remind you that you need to keep pressing the continue button to see the remaining demo programs.
If you are using demoplt as a test suite to verify that plt is installed properly, you can do this without having to manually click the mouse to start each demo as described above. Simply RIGHT click on the All Programs button. This will cycle quickly thru all the demo programs with no human interaction required and you won't see the small window above reminding you to press the continue button. There are no pauses between each demo program and so this is also useful for performance testing since the elapsed time required to run all the demos is displayed in the command window. A similar way of doing this without even having to press the All Programs button is to type this at the command prompt:
demoplt go
Or of course, you could use the functional form demoplt('go'). This will cycle automatically thru all 37 programs just as if you had right clicked on the All Programs button, except that the demoplt figure window is closed after the last demo program has been executed.
One additional way of starting demoplt is by typing:
demoplt Go
The result is similar to what happens with the lowercase "go" except that a one-second pause is added after each demo is executed. This gives you a little more time so you can verify that each figure was rendered properly before moving on to the next demo in the sequence. The elapsed time shown after completion will be about 37 seconds longer than with the lowercase "go" because of the one-second pause after each program is started.
In addition to its main role as a demo program launcher, demoplt demonstrates the use the ColorPick pseudo object. (A pseudo object is a collection of more primitive Matlab objects, assembled to perform a common objective.) The ColorPick pseudo object is useful whenever you want to allow the user to have control over the color of one of the graphic elements. In demoplt there are 4 such elements: The text color, the text background color, the button color, and the figure background color. The ColorPick window is activated when you click on any of the three small color squares (frames) or if you right-click on the figure background edit box. When the ColorPick window appears you can use the sliders or the color patches to change the color of the respective graphic element. For more details, see the Pseudo objects section of the help file.
An optional feature of the ColorPick object is the color change callback function - a function that's called whenever a new color is selected. This feature is demonstrated here by reporting all color changes at the top of the listbox (i.e. before the example code listing).
If you have changed the figure size or position, the fontsize popup, or any color selection, then when you close the demoplt figure window you will see a dialog box consisting of these three buttons:

- Save setup changes (will create a "demoplt.mat" file in the plt\ini folder)
- Exit without saving
- Reset to default settings (will delete the demoplt.mat if it exists)

Note that when demoplt creates the figure window, it assigns the 'CloseRequestFcn' property to the command 'demoplt close' which creates the dialog box discussed above.
See the pltSig.exe section for information about running the compiled version of demoplt.