web
Open web page or file in browser
Syntax
Description
web(
opens the page specified by
url
)url
in a web browser. If url
is an
external site or a documentation page (including custom documentation pages),
web(url)
opens the page in your system web browser.
Otherwise, the page opens in the HTML Viewer. If multiple browsers are open, the
page displays in the one that was most recently used.
web(
opens the page using the specified browser option, such as
url
,opt
)'-new'
to create a new web browser instance or
'-browser'
to use the system web browser.
On Microsoft® Windows® and Apple Macintosh platforms, the operating system determines the system web browser. On other systems, the default is the Mozilla® Firefox® browser, but you can change the default using MATLAB® Web settings.
web
opens an empty HTML Viewer tab. If a HTML Viewer tab
is already open, web
does nothing.
returns
the status of the operation: stat
= web(___)0
if successful,
1
or 2
if unsuccessful. You can
include any of the input arguments in previous syntaxes.
[
returns a handle to a HTML Viewer tab that allows
you to close it using the command stat
,h
]
= web(___)close(h)
. If the page opens
in the system web browser, web
returns an empty
handle.
If you do not specify any inputs to the web
function, such
as [stat,h] = web
, then the handle corresponds to the most
recently used HTML Viewer.
Examples
Input Arguments
Output Arguments
Limitations
MATLAB Online™ only supports the
web(url)
syntax. Callingweb(url)
in MATLAB Online opens the page specified byurl
in your web browser.The
web
function does not support thetext://
URL scheme when opening pages in the system web browser or from a deployed application.
Tips
If you plan to deploy an application that calls the
web
function using the MATLAB Compiler™ product, use the'-browser'
option to open all pages in the system web browser.If you are displaying Japanese streaming text in the HTML Viewer, specify a header that includes the
charset
attribute. For example:web(['text://<html><head><meta http-equiv="content-type" ' ... 'content="text/html;charset=utf-8"></head><body>TEXT</body></html>'])