MATLAB Function Reference Previous page   Next Page
web

Open Web site or file in Web browser or Help browser

Syntax

Description

web opens an empty MATLAB Web browser. The MATLAB Web browser includes an address field where you can enter a URL (Uniform Resource Locator), for example to a Web site or file, a toolbar with common browser buttons, and a MATLAB desktop menu.

web url displays the specified URL url in the MATLAB Web browser. If any MATLAB Web browsers are already open, displays the page in the browser that last had focus. Files up to 1.5MB in size display in the MATLAB Web browser, while larger files instead display in the default Web browser for your system. If url is located in the directory returned when you run docroot, the URL displays in the MATLAB Help browser instead of the MATLAB Web browser.

web url -new displays the specified URL url in a new MATLAB Web browser.

web url -notoolbar displays the specified URL url in a MATLAB Web browser that does not include the toolbar and address field. If any MATLAB Web browsers are already open, also use the -new option; otherwise url displays in the browser that last had focus, regardless of its toolbar status.

web url -noaddressbox displays the specified URL url in a MATLAB Web browser that does not include the address field. If any MATLAB Web browsers are already open, also use the -new option; otherwise url displays in the browser that last had focus, regardless of its address field status.

web url -helpbrowser displays the specified URL url in the MATLAB Help browser.

web url -browser displays the default Web browser for your system and loads the file or Web site specified by the URL url in it. Generally, url specifies a local file or a Web site on the Internet. The URL can be in any form that the browser supports. On Windows and Macintosh, the default Web browser is determined by the operating system. On UNIX, the Web browser used is specified via docopt in the doccmd string.

web(...) is the functional form of web.

stat = web('url', '-browser') runs web and returns the status of web to the variable stat.

Value of stat
Description
0
Browser was found and launched.
1
Browser was not found.
2
Browser was found but could not be launched.

[stat, h1] = web returns the status of web to the variable stat, and returns a handle to the Java class, for the last active browser.

[stat, h1, url] = web returns the status of web to the variable stat, returns a handle to the Java class for the last active browser, and returns its current URL to url.

Examples

Run

and MATLAB displays

web http://www.mathworks.com loads the MathWorks Web site home page into the MATLAB Web browser.

web file:///disk/dir1/dir2/foo.html opens the file foo.html in the MATLAB Web browser.

web(['file:///' which('foo.html')])opens foo.html if the file is on the MATLAB path or in the current directory.

web('text://<html><h1>Hello World</h1></html>') displays the HTML-formatted text Hello World.

web ('http://www.mathworks.com', '-new', '-notoolbar') loads the MathWorks Web site home page into a new MATLAB Web browser that does not include a toolbar or address field.

web file:///disk/dir1/foo.html -helpbrowser opens the file foo.html in the MATLAB Help browser.

web file:///disk/dir1/foo.html -browser opens the file foo.html in the system Web browser.

web mailto:email_address uses your system browser's default e-mail application to send a message to email_address.

web http://www.mathtools.net -browser opens a browser to mathtools.net. Then [stat,h1,url]=web returns

Run methods(h1) to view allowable methods for the class. As an example, you can use the method setCurrentLocation to change the URL displayed in h1, as in

See Also

doc, docopt, helpbrowser, matlab:


Previous page  wavwrite weekday Next page

© 1994-2005 The MathWorks, Inc.