MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Guida di Installazione

Navigare online o scaricare Guida di Installazione per Software di desktop per la pubblicazione MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE. MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Installation guide Manuale Utente

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa

Sommario

Pagina 1 - MATLAB Web Server

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

Pagina 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

Pagina 3 - Contents

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

Pagina 5 - Selected Bibliography

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

Pagina 6

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

Pagina 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

Pagina 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

Pagina 9 - Typographical Conventions

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

Pagina 10 - Preface

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

Pagina 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

Pagina 12

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 18

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

Pagina 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

Pagina 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

Pagina 21

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

Pagina 22

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

Pagina 23 - Startup Sequence

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

Pagina 24

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

Pagina 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

Pagina 26

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

Pagina 27 - Stopping VNC

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

Pagina 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

Pagina 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

Pagina 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

Pagina 31

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

Pagina 32

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

Pagina 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

Pagina 34

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

Pagina 35 - M-File Template

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

Pagina 36

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

Pagina 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

Pagina 38

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

Pagina 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

Pagina 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

Pagina 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 =

Pagina 42

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

Pagina 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

Pagina 44

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

Pagina 45

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

Pagina 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

Pagina 47

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

Pagina 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

Pagina 49 - Inside the MATLAB

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

Pagina 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

Pagina 51

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

Pagina 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.

Pagina 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

Pagina 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

Pagina 56

iv Contents

Pagina 57

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

Pagina 58 - Returning Results via the Web

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

Pagina 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

Pagina 60 - 4 Reference

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

Pagina 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

Pagina 62

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

Pagina 63

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

Pagina 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,

Pagina 67 - See Also getfield

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

Pagina 68

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

Pagina 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

Pagina 70 - A Directory Structure

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

Pagina 71

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

Pagina 72

A Directory StructureA-6

Pagina 73

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

Pagina 74

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

Pagina 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

Pagina 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

Pagina 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

Pagina 78

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

Pagina 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

Pagina 80

CSelected Bibliography

Pagina 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

Pagina 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

Pagina 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

Pagina 84

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

Pagina 85

IndexI-6

Pagina 86

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

Commenti su questo manuale

Nessun commento