| MATLAB Function Reference | ![]() |
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
web opens an empty MATLAB® Web Browser. The MATLAB Web browser includes an address field where you can enter a URL, 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, it 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 (an unsupported utility), 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 Microsoft® Windows® and Apple® Macintosh® platforms, the default Web browser is determined by the operating system. On The Open Group UNIX® platforms, 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 Sun Microsystems™ Java™ class, h1, for the last active browser. Run methods(h1) to view allowable methods for the class. 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 link 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. Run methods(h1) to view allowable methods for the class.
Run
web http://www.mathtools.net
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 search path or in the current directory 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 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.
[stat,h1,url]=web for that web statement returns
stat =
0
h1 =
com.mathworks.mde.webbrowser.WebBrowser[,0,0,591x140,
layout=java.awt.BorderLayout,alignmentX=null,alignmentY=null,
border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
url =
http://www.mathtools.net/
As an example, you can use the method setCurrentLocation to change the URL displayed in h1, as in
setCurrentLocation(h1,'http://www.mathworks.com')
[stat,h1]=web('http://www.mathworks.com') opens mathworks.com in a browser. Then close(h1) closes the browser.
doc, docopt, helpbrowser, matlabcolon
Web Browser in the MATLAB Desktop Tools and Development Environment documentation
![]() | wavwrite | weekday | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |