Similar to a character string, but displays itself in the command window as a clickable link.
Updated 26 Jun 2020

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 (2024). Link (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Characters and Strings in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Added an example to get to hyperlinks documentation.

Changed property validation to new syntax.

Added input checking and enforcement.