MATLAB Web Server Previous page   Next Page

Additional Application Examples

The easiest way to learn how to create MATLAB applications that send and receive data over the Web is to analyze the sample programs included with your MATLAB Web Server distribution. To access these sample programs, open the file <matlab>/toolbox/webserver/wsdemos/index.html in your browser. By analyzing the code used to create these examples, you can expand upon them to create more complex MATLAB Web Server applications.

Data Display

The players demonstration function illustrates a basic use of the MATLAB Web Server to display data over the Web. The file players.txt contains a data base with information about The MathWorks softball team.

PLAYER
POSITION
AVERAGE
AT BATS
Ron Berg
First Base
.337
30
John Theytaz
Second Base
.294
22
Charles Carmody
Third Base
.261
34
Debby Oldman
Shortstop
.287
29
Jack Pirrotta
Right Field
.256
27
Josh Tillson
Center Field
.301
31
Eugene Goldbrick
Left Field
.281
31
Donna Navillus
Pitcher
.222
32
Anna Alman
Catcher
.290
30

players uses a few MATLAB commands to read the tab-delimited file, convert the data to an HTML file, and display the output in a Web browser. No input form is needed for this application, only a URL. The URL can be entered directly in your browser or as a live link in another page.

The URL for the players example is

on Windows NT. (On Solaris/Linux use matweb instead of matweb.exe.)

The output looks like

If you would like to experiment on your own with a similar simple application, use players as a model to create an M-file that reads your own text file, e.g., myfile.txt, and places data into a MATLAB structure. To display the result in your Web browser, use the above URL, changing the value of the mlmfile argument to the name of your new M-file. Also, copy the entry for players in matweb.conf and change the name of the application within the brackets [] to the one you have chosen.


Previous page  Debugging Your Application MATLAB Graphics Next page