MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Installation Guide

Browse online or download Installation Guide for Desktop publishing software MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE. MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Installation guide User Manual

  • Download
  • Add to my manuals
  • Print

Summary of Contents

Page 1 - MATLAB Web Server

ComputationVisualizationProgrammingFor Use with MATLAB®MATLAB Web ServerVersion 1MATLAB Web Server

Page 2 - How to Contact The MathWorks:

PrefaceviiiRelated ProductsThe MATLAB Web Server requires MATLAB Release 11 or later. No other MathWorks-supplied software is required.See “Product R

Page 3 - Contents

Related ProductsixMATLAB C/C++ Graphics LibraryLibrary for automatically compiling MATLAB programs that contain graphics and graphical user interfaces

Page 5 - Selected Bibliography

1MATLAB on the WebIntroduction . . . . . . . . . . . . . . . . . . . . 1-2MATLAB Web Server Environment .

Page 6

1 MATLAB on the Web1-2IntroductionMATLAB Web Server EnvironmentThe MATLAB® Web Server enables you to create MATLAB applications that use the capabilit

Page 7

Introduction1-3In a more complex network, the Web server daemon can run on a machine apart from the others.Building MATLAB Web Server ApplicationsMATL

Page 8

1 MATLAB on the Web1-43 Write a MATLAB M-file that:a Receives the data entered in the HTML input form.b Analyzes the data and generates any requested

Page 9 - Typographical Conventions

Product Requirements1-5Product RequirementsThe MATLAB Web Server has the same supporting hardware and software requirements as MATLAB itself, except f

Page 10 - Preface

1 MATLAB on the Web1-6InstallationAvailabilityThe MATLAB Web Server is available on UNIX (Solaris) workstations and IBM PC compatible computers runnin

Page 11 - Related Products

Installation1-7-m 1This number represents the number of MATLABs that can run concurrently. After testing that everything is working properly, you can

Page 12

How to Contact The MathWorks:www.mathworks.com Webcomp.soft-sys.matlab [email protected] Technical [email protected] Product

Page 13 - MATLAB on the Web

1 MATLAB on the Web1-8•Copy matweb.conf in <matlab>/toolbox/webserver/wsdemos to the directory aliased by /cgi-bin or equivalent. •Copy all demo

Page 14 - 1 MATLAB on the Web

Installation1-9at the command prompt to see detailed information about a specific script.After completing the MATLAB and MATLAB Web Server installatio

Page 15 - Introduction

1 MATLAB on the Web1-103 Open the copied file in a text editor and follow the directions for modifying the file. Save and close the file when you are

Page 16

Installation1-114 Solaris users should create a link in the rc directory associated with run level 3.cd /etc/rc3.d; ln -s ../init.d/webserver S20webse

Page 17 - Web Server

1 MATLAB on the Web1-12DeinstallationTo remove MATLAB Server from the Windows NT Registry, open a command prompt (MS-DOS) window. Enter the command se

Page 18

Graphics Display1-13Graphics DisplayWe recommend that Solaris/Linux users use Virtual Network Computing (VNC) for their X display. VNC can be used eve

Page 19 - Installation

1 MATLAB on the Web1-14The file directory created contains a README file that discusses how to install the software. The directory contains four files

Page 20

Graphics Display1-15The first time you run the vncserver, you will be prompted for a password. This password controls access to the VNC viewer, which

Page 21

1 MATLAB on the Web1-16webstart -display :1[webstart]:Calling webdown to take down MATLAB Web Server . . . No s

Page 22

2Getting StartedIntroduction . . . . . . . . . . . . . . . . . . . . 2-2Templates . . . . . .

Page 23 - Startup Sequence

iContentsPrefaceAbout This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viOrganization of the Document . . . .

Page 24

2 Getting Started2-2IntroductionThe process of creating a MATLAB Web Server application involves the creation of:•An HTML input document for data subm

Page 25 - Graphics Display

Introduction2-3•webmagic1.html: the webmagic input document•webmagic2.html: the webmagic output document•webmagic.m: the webmagic MATLAB M-file•twebma

Page 26

2 Getting Started2-4Creating Input DocumentsInput TemplateThe file input_template.html provides the code needed to create a MATLAB Web Server input do

Page 27 - Stopping VNC

Creating Input Documents2-5<p><input type="submit" name="Submit" value="Submit"></p><!-- STEP 5Add

Page 28

2 Getting Started2-6To display the input document and run the magic squares demonstration locally on your computer, start your Web browser and set the

Page 29 - Getting Started

Creating MATLAB Web Server M-Files2-7Creating MATLAB Web Server M-FilesM-File TemplateYou use the M-file template to code your MATLAB application as y

Page 30 - 2 Getting Started

2 Getting Started2-8% created and the filename you created from OUTPUT_TEMPLATE.HTML.% Replace <OUTPUT_TEMPLATE.HTML> with the name of the HTML

Page 31

Creating MATLAB Web Server M-Files2-9% Create magic square in output structure OUTSTRUCT.outstruct.msquare = magic(msize);% Get column, row, and diago

Page 32

2 Getting Started2-10Creating Output DocumentsOutput TemplateThe file output_template.html provides the code needed to create a MATLAB Web Server outp

Page 33 - Creating Input Documents

Creating Output Documents2-11The source for the webmagic2.html template document looks like<!--HTML output template used by webmagic.m in call to t

Page 34

ii Contents2Getting StartedIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2Templates . . . . . .

Page 35 - M-File Template

2 Getting Started2-12When displayed in a browser, webmagic2.html looks like

Page 36

Debugging Your Application2-13Debugging Your ApplicationDebugging ProcedureYou can use the MATLAB debugging facility plus your Web browser to debug yo

Page 37 - (Step 6)

2 Getting Started2-14outfile in this case is twebmagic.html, the second argument passed to webmagic.The second step in debugging is to use your Web br

Page 38

Additional Application Examples2-15Additional Application ExamplesThe easiest way to learn how to create MATLAB applications that send and receive dat

Page 39 - Creating Output Documents

2 Getting Started2-16The URL for the players example ishttp://<your_domain>/cgi-bin/matweb.exe?mlmfile=players& on Windows NT. (On Solaris/L

Page 40

Additional Application Examples2-17This input document allows you to set the characteristics of the peaks plot you want to generate. This is a more co

Page 41 - Debugging Your Application

2 Getting Started2-18also be used to maintain contexts among the different connections in an application.You can see this in the codes.GraphFileName =

Page 42

Additional Application Examples2-19Note When the input form contains a “clickable” image created by an <input> tag of the form <type = "

Page 43 - Data Display

2 Getting Started2-20Stock Price SimulationNow that you are familiar with the use and operation of the MATLAB Web Server, look at webstock, a program

Page 44

3Inside the MATLAB Web Server MATLAB Web Server Components . . . . . . . . . . 3-2File Locations . . . . . . . .

Page 45

iii4ReferenceFunction Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2htmlrep . . . . . . . . . . . . . . . . . .

Page 46

3 Inside the MATLAB Web Server3-2MATLAB Web Server ComponentsThe MATLAB Web Server consists of a set of programs that enable MATLAB programmers to cre

Page 47

3-3:Figure 3-1: MATLAB on the WebInitial HTMLForm or URLGenerated HTML FormClient1MATLABClientnhttp daemonmatwebmatlabserver M-filesDataGraphicsInit

Page 48

3 Inside the MATLAB Web Server3-4File LocationsAny M-files used in conjunction with a Web application, including matweb.m, must appear on the MATLAB p

Page 49 - Inside the MATLAB

Understanding matlabserver3-5Understanding matlabservermatlabserver is designed to run continuously in the background as a Windows NT service or as a

Page 50 - MATLAB Web Server Components

3 Inside the MATLAB Web Server3-6Note that the values for the variables can contain references to other shell variables using the normal shell $ notat

Page 51

Understanding matlabserver3-7Changing Initial DataEdit matlabserver.conf on Windows NT. On Solaris/Linux run the webconf script to initialize the matl

Page 52 - File Locations

3 Inside the MATLAB Web Server3-8When the MATLAB Web Server is installed, matweb is placed in <matlab>/webserver/bin/arch for all architectures.

Page 53 - Understanding matlabserver

Understanding matlabserver3-9All the fields that can be contained in matweb.conf are described in Table 3-2.After you create a new MATLAB Web Server a

Page 54

3 Inside the MATLAB Web Server3-10matweb M-FileLooking again at the source from the webmagic1.html file (see “webmagic Input” on page 2-5), observe th

Page 56

iv Contents

Page 57

4 Reference4-2Function SummaryThis chapter provides detailed descriptions of the functions in the MATLAB Web Server.Function PurposehtmlrepReplace var

Page 58 - Returning Results via the Web

htmlrep4-34htmlrepPurpose Substitute values for variable names in HTML documentSyntax outstring = htmlrep(instruct,infile)outstring = htmlrep(instruc

Page 59

htmlrep4-4Note The extendmemory attribute is designed only for use with htmlrep independently of the MATLAB Web Server. Using it with the MATLAB Web

Page 60 - 4 Reference

htmlrep4-5<SELECT NAME="NAMELIST" SIZE=10 AUTOGENERATE=$mylist$ MULTIPLE> <OPTION SIZE=6> </SELECT> htmlrep uses the HTML

Page 61 - 4htmlrep

matweb4-64matwebPurpose MATLAB Web Server main entry point Syntax matweb(instruct)Description matweb is an M-file that in turn calls a MATLAB applicat

Page 62

wscleanup4-74wscleanupPurpose Purge stale files from directorySyntax deletecount = wscleanup(filespec,timewindow,direc)deletecount = wscleanup(filespe

Page 63

wsprintjpeg4-84wsprintjpegPurpose Create JPEG fileSyntax status = wsprintjpeg(fig, jpegfilename)Description status = wsprintjpeg(fig, jpegfilename) cr

Page 64 - Syntax matweb(instruct)

wssetfield4-94wssetfieldPurpose Add new field or append to existing field Syntax s = wssetfield(s,name1,value1,...)Description s = wssetfield(s,name1,

Page 65 - 4wscleanup

wssetfield4-10

Page 67 - See Also getfield

PrefaceAbout This Book . . . . . . . . . . . . . . . . . . . viOrganization of the Document . . . . .

Page 68

A Directory StructureA-2MATLAB is distributed in compressed format on CD. The installation procedure moves the files to your hard disk, decompresses t

Page 69

A-3You must also place a copy of the appropriate matweb executable and matweb.conf into the /cgi-bin aliased subdirectory of the HTTP server root d

Page 70 - A Directory Structure

A Directory StructureA-4Table A-4: <matlab>/toolbox/webserver/wsdemos File Purposedummy.htmlTemporary HTML document in bottom frame of webpeaks

Page 71

A-5File Purposewebpeaks1.htmlHTML framewebpeaks2.htmlpeaks plot output formwebstock.htmlStock price simulation input formwebstock1.htmlStock price sim

Page 72

A Directory StructureA-6

Page 73

BTroubleshooting Web ServerGeneral Troubleshooting . . . . . . . . . . . . . . . B-2Additional Troubleshooting for Wi

Page 74

B Troubleshooting Web ServerB-2This section provides three categories of troubleshooting information:•General Troubleshooting•Additional Troubleshooti

Page 75 - Troubleshooting Web

B-3Application-Specific Log File Not ProducedIf present, the mllog variable in matweb.conf ( see “matweb.conf” on page 3-8) creates an application-spe

Page 76 - B Troubleshooting Web Server

B Troubleshooting Web ServerB-41 matlabserver is not running.On Solaris or Linux run the webstat script. On Windows NT click the Start button, open th

Page 77 - Connect() failure Error

B-5Viewer appears, click on Log on the menu bar and choose Application from the pull-down menu.Double-click on a matlabserver entry to receive additio

Page 78

PrefaceviAbout This BookThis book describes the MATLAB® Web Server. The MATLAB Web Server lets you deploy MATLAB based applications over a network us

Page 79

B Troubleshooting Web ServerB-6Startup SequenceIf you install a new version of MATLAB and the MATLAB Web Server, you need to start MATLAB before start

Page 80

CSelected Bibliography

Page 81

C Selected BibliographyC-2Numerous books have been published about HTML programming and the World Wide Web. Two that we have found both useful and rea

Page 82 - C Selected Bibliography

I-3IndexAalias 1-8aliases 1-7applications 1-3authoring systems 1-3availability 1-6Bbind error B-3browsers 1-5Cconfiguration files 3-2configuration set

Page 83

IndexI-4nomenclature 2-5single entry B-4matweb program 3-7matweb.conf 3-8application development 1-3format 1-6locating graphic files 1-7mldir 3-9mllog

Page 84

IndexI-5Solaris B-6Windows NT B-4twebmagic.m 2-13typographical conventions (table) viiVvirtual network computing (VNC) 1-13VNCvirtual network computin

Page 85

IndexI-6

Page 86

Typographical ConventionsviiTypographical ConventionsThis manual uses some or all of these conventions.Item Convention Used ExampleExample code Monosp

Comments to this Manuals

No comments