File Exchange

image thumbnail

Link

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

2 Downloads

Updated 16 Oct 2015

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:

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

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

Cite As

Sky Sartorius (2019). Link (https://www.mathworks.com/matlabcentral/fileexchange/48638-link), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

John D'Errico

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

Matthew

Nice.

Updates

1.1.0.0

Added input checking and enforcement.

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