MATLAB Runtime Server    

Overview of the Application

This example is a simple GUI-driven application that calculates and displays an amortization schedule. If you have added toolbox\runtime\examples\gui to the MATLAB path, then you can run the application by typing

at the command line. At first, the GUI looks like this.

To use the application, enter expressions in the GUI fields and press the Calculate button. After you enter values and press Calculate, the GUI looks like this.

The Clear button deletes the numbers that you entered in the four input fields. The Close button exits the application. If the application is running with the Runtime Server or with commercial MATLAB in runtime emulation mode, then the Close button also exits MATLAB.

How the Application Files Interact

If you run the application with the Runtime Server, then the Runtime Server first executes matlabrt, which in turn invokes pathdefrt. The function matlabrt also executes amortsched, which sets up the GUI and the buttons' callback functions. Below is an excerpt from amortsched.m.

Pressing the buttons invokes amortsched_cb with an argument indicating which button was pressed. The function amortsched_cb uses a switch structure to perform the actions associated with each GUI button. The lines below show the structure of amortsched_cb.m.

When necessary, amortsched_cb invokes other functions to compute or display results.

The figure below illustrates schematically which functions call each other in this application.


  Installing the Example Files Adapting the Design for Runtime Execution