Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

web - Open Web site or file in Web or Help browser

Syntax

web
web url
web url -new
web url -notoolbar
web url -noaddressbox
web url -helpbrowser
web url -browser
web(...)
stat = web('url', '-browser')
[stat, h1] = web
[stat, h1, url] = web

Description

web opens an empty MATLAB Web browser.

web url displays the page specified by url in the MATLAB Web browser. If any MATLAB Web browsers are already open, it displays the page in the browser that was used last. Files up to 1.5 MB in size display in the MATLAB Web browser, while larger files instead display in the system Web browser. The web function accepts a valid URL such as a web site address, a full path to a file, or a relative path to a file (using url within the current folder if it exists there). If url is located in the folder returned when you run docroot (an unsupported utility function), the page displays in the MATLAB Help browser instead of the MATLAB Web browser.

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

web url -notoolbar displays the page specified by urlin 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 was used last, regardless of its toolbar status.

web url -noaddressbox displays the page specified by urlin 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 was used last, regardless of its address field status.

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

web url -browser displays url in a system Web browser window. url can be in any form that the browser supports. On Microsoft Windows and Apple Macintosh platforms, the system Web browser is determined by the operating system. On UNIX[1] platforms, the default system Web browser for MATLAB is Mozilla Firefox®. To specify a different browser, use MATLAB Web preferences.

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 Sun Microsystems Java class, h1, for the last active browser. You can use close(h1) to clear the displayed page from the browser. The browser, h1, could have been opened when the web function was previously executed, or when a tool ran the web function. For example, clicking a link to an external site from the Help browser runs web to open the Web site in a system browser, and h1 would be the handle for that browser instance.

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

Examples

Display the Mathtools Web site:

web http://www.mathtools.net

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 mydir/myfile.html opens myfile.html in the MATLAB Web browser, where mydir is in the current folder.

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

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 the system browser's default e-mail application to send a message to email_address.

web http://www.mathtools.net -browser opens the system Web browser at mathtools.net.

[stat,h1]=web('http://www.mathworks.com'); opens mathworks.com in a MATLAB Web browser. Then, close(h1) clears the displayed URL, mathworks.com, from the browser window.

See Also

doc, helpbrowser, matlabcolon, urlread, urlwrite

Related topics in the User Guide:


[1] UNIX is a registered trademark of The Open Group in the United States and other countries.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS