Links to matlab documentation in "published" html pages

16 views (last 30 days)
I have a matlab file published to html, and in my comments I want to include links to matlab documentation for some of the functions. I'm using the syntax for links found here, under "Dynamic link to a matlab function reference page". Here is one of my links:
<matlab:doc('cumsum') cumsum>
I tried clicking on the links in Firefox and in Google Chrome, both times with Matlab running. In Firefox, it said "Firefox doesn't know how to open this address, because the protocol (matlab) isn't associated with any program", and in Chrome, it just did nothing. What am I doing wrong?
  2 Comments
Frances
Frances on 11 Jun 2012
I think I have that... is that the one that pops up when you type, for example, "doc cumsum" in the command window?
per isakson
per isakson on 11 Jun 2012
That requires the built-in browser of Matlab: web('name_of_file.html')

Sign in to comment.

Accepted Answer

Frances
Frances on 19 Jun 2012
This is the reply I got from Mathworks tech support:
" The links that created by syntax “<matlab:doc(‘cumsum’) cumsum) can only work from MATLAB web browser. The reason is that other web browsers do not recognize the MATLAB command line.
If you would like to provide the link to the function documentation, the possible workaround would be using the URL to the web documentation directly. You can find out the web documentation URL for CUMSUM function from executing the following command in MATLAB Command Prompt: >>doc cumsum
This will launch the MATLAB Help windows. From the menu bar, select View -> Page Location. The URL will be shown in the dialog box. And you can add the syntax “<URL Cumsum>” into the file where you want to insert the link. However, in order to view the web documentation, the user who clicks that link will need to register an account in “www.mathworks.com”.
For more information about how to include the hyperlinks in MATLAB files for publishing, you can execute the following command line in MATLAB Command Prompt: >>web([docroot '/techdoc/matlab_env/f6-30186.html#brcpys5']) "
So for any browser other than Matlab I have to use the URL for the Mathworks website instead of the "doc:" command... it seems a little silly that this isn't mentioned in the documentation.
  1 Comment
Walter Roberson
Walter Roberson on 19 Jun 2012
Caution: the web link that is given assumes that the software release is the current release. In the example given, you would get the link to the _current_ version of cumsum(), which might have changed since the version for your release.
Users do not need a mathworks.com account to view current software documentation, if I recall correctly. They do, however, need an account linked against a license in order to view documentation for older releases.

Sign in to comment.

More Answers (2)

Sean de Wolski
Sean de Wolski on 11 Jun 2012
Use the direct URL to the online documentation, e.g:
%%to be published
%Hello
a = pi;
%%World
% <http://www.mathworks.com/help/releases/R2012a/techdoc/ref/cumsum.html doc cumsum>
magic(3)
  1 Comment
Frances
Frances on 11 Jun 2012
When I use that link, it says "Warning - File or URL not found: Matlab cannot link to this file or URL". I'm using Matlab R2011a. When I use the http://www.mathworks.com/help/techdoc/ref/cumsum.html doc instead, it says "This page does not display correctly in your version of the MATLAB Web Browser" and gives the link so you can open it in your own browser. How do I get it either so the Matlab web browser works, or it opens the links in the computer's default browser to begin with?

Sign in to comment.


per isakson
per isakson on 11 Jun 2012
I published
%%test
% See the local help for the <matlab:doc('publish') publish> function.
% Documentation on The Mathworks web site:
% <http://www.mathworks.se/help/techdoc/ref/cumsum.html cumsum>
to 'h:\m\cssm\html\cssm.html' and run
>> winopen('h:\m\cssm\html\cssm.html')
>> web('h:\m\cssm\html\cssm.html')
winopen launched Internet Explorer, which reports: "The webpage cannot be displayed" for the link Publish. I get the same result when I open the file with a browser outside Matlab.
With web both links works (as described in the documentation).
--- Cont. ---
The "malab:doc" line above is copied from R2012a online help
Mark Up MATLAB Comments for Publishing / Dynamic Link to a MATLAB Function Reference Page
--- Cont. ---
  5 Comments
per isakson
per isakson on 18 Jun 2012
AFAIK: That the way it works. Did you ask the Mathwork tech support?
per isakson
per isakson on 18 Jun 2012
Would you allow <matlab:eval('a=1+3') Add> on your website?

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!