How to open a specific web page or specific file in MatLab? - web -- MatLab

 How to open a specific web page or  specific file in MatLab? - web -- MatLab


How to open a specific web page or  specific file in MatLab?
[Ans]
web

[Description]

web

It will create and open new empty url page.

[<stat>,<h>,<url>]=web(<urlAddress>);
[<stat>,<h>,<url>]=web(<urlAddress>,<opt_1>,...,<opt_nth>);

It will open specific url page with specific url address <urlAddress> with opt_1 , ... , opt_nth.

stat means that status of openin url
0 successful.
1 or 2 unsuccessful.

h means a handling about web page.
So you can close the web with close(h) command.

url means current url web page.


[NOTE]
(1)If urlAddress is an external site, web(urlAddress) opens the page in your system browser. 
(2)If multiple browsers are open, the page displays in the one that was most recently used.
(3) If the page opens in a system browser, web returns an empty URL.
(4)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 MATLAB web browser.

more details on:

code
clear
clc
help web;
fprintf("Hello MatLab");
url = 'https://www.mathworks.com';
[stat,h,url]=web(url)%open 'https://www.mathworks.com'
fprintf("1\n");
%[stat,h,url]=web('text://<html><h1>Hello World</h1></html>')
%{
produce compiler error
Error using web>find_path (line 115)
Directory does not exist.
Error in web (line 89)
html_file = find_path(html_file);
Error in web_example (line 8)
[stat,h,url]=web('text://<html><h1>Hello World</h1></html>')
%}

Comments