File Exchange

image thumbnail


version (1.88 KB) by Sky Sartorius
Similar to a character string, but displays itself in the command window as a clickable link.


Updated 26 Jun 2020

View Version History

View License

Link(target) creates a Link object pointing to location or code defined by target, e.g., a URL.
Link(target, text) will display text instead of the target.
To add a hyperlink to a longer string, e.g., using sprintf, use the Link object's str property.

Examples included in help:

Link('matlab:docsearch hyperlinks', 'Learn more about MATLAB hyperlinks')

lnk = Link('matlab:ezplot(@cos)', 'Display cosine function')

lnk = Link('', 'MATLAB Central');
disp('The link can be shown by normal display:')
disp('Or by using the function disp:')
disp('Alternatively, access the object''s str property:')
fprintf('Go to %s for lots of great resources.\n', lnk.str);

Cite As

Sky Sartorius (2021). Link (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Sky Sartorius

Thanks, Stephen. You inspired me to add an example that takes the user to that documentation.

Chang hsiung

John D'Errico

I quite like this. Thank you for posting. Well written. Good help, examples, etc.



MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!