How do I display a hyperlink in the help text of my function such that clicking the link opens a PDF-file and jumps to a specific page?

8 views (last 30 days)
I would like to know how to display a hyperlink in the help text of my function such that clicking the link opens a PDF-file and jumps to a specific page.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Aug 2013
If you are using MATLAB 7.9 (R2009b) or a later release, you may use the following function template to create the required hyperlink:
function b = myfun(a)
% <a href="91661v00.pdf#page=2">Page 2</a>
b = a * 2;
end
>> help myfun
If you are using MATLAB 7.8 (R2009a) or an older release, you may use the following function template to create the required hyperlink:
function b = myfun(a)
% <a href="matlab: temp = pwd; cd('C:\Program Files\Adobe\Reader 9.0\Reader'); dos(['AcroRd32.exe /A ' char(34) 'page=2' char(34) ' C:\work\matfile_format.pdf &']); cd(temp)">Local PDF Page 2</a>
b = a * 2;
end
>> help myfun
In the above template:
- Adobe Reader 9.0 has been used explicitly by navigating into its installation folder to open the PDF-file.
- Variable "temp" has been used to change the folder back to the working folder.
- ASCII code for double quote ("), char(34) has been used since some special characters may not be interpreted correctly as per the documentation of MATLABCOLON (matlab:).
<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabcolon.html>

More Answers (0)

Categories

Find more on Create Large-Scale Model Components in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!