MATLAB Web Server Previous page   Next Page

Debugging Your Application

Debugging Procedure

You can use the MATLAB debugging facility plus your Web browser to debug your application before making it available to all users.

An effective method of debugging is to write your application M-file to accept two arguments, as in

You can use the second argument to create an HTML file that displays test output.

As a first debugging step, create a driver program that sets up the input variables and calls the main function. You can use the MATLAB debugging facilities to check the logic of your test program. The file twebmagic.m located in <matlab>/toolbox/webserver/wsdemos is an example of such a driver program. (Note the use of the wssetfield function to create the test input variables. This is optional. Elements of the structure s could be created directly, e.g., s.msize = '5'.)

Because the driver program calls webmagic with two arguments, webmagic writes its output to the file twebmagic.html. The call to htmlrep within the webmagic function handles this.

outfile in this case is twebmagic.html, the second argument passed to webmagic.

The second step in debugging is to use your Web browser to examine your test file (outfile)and make appropriate changes until the output is displayed as you intend.

Debugging Template

To assist you in debugging, we have provided the template tmfile_template.m, shown below in abbreviated form.

Previous page  Creating Output Documents Additional Application Examples Next page