2%HYPERLINK create a
string that is displayable as
hyperlink in Matlab console
5% fprintf(
'Search on %s\n',
hyperlink(
'http://google.com',
'Google'));
6% fprintf(
hyperlink(
'http://google.com',
'Google',
'Search on Google\n'));
8% HYPERLINK converts the specified URL and text label into a
string that is
9% displayed as a
hyperlink in the Matlab console (Command Window).
10% In a deployed (compiled) program, the URL and text label (
if different
11% from the URL) are displayed in a non-hyperlinked plain-text manner.
12% If the optional 3rd input argument (msg) is specified, then all instances of
13% the specified label within msg will be handled as above (hyperlinked etc.)
16% url - (mandatory) URL of webpage or Matlab command (e.g.,
'matlab:which(...')
17% label - (optional) text label of the
hyperlink. Default: url
18% msg - (optional)
string in
which all label instances should be hyperlinked
23% Copyright: Yair Altman 2020-
28 error(nargchk(1,3,nargin)); %#ok<NCHKN> narginchk is only available in R2011b+
29 if nargin > 2 % msg was specified
30 % replace all instances of label within msg with corresponding
hyperlink
31 str = strrep(msg, label,
hyperlink(url,label));
34 if nargin < 2, label = url; end
35 isWebpage = strncmpi(url,
'http',4);
37 % Only
hyperlink in interactive Matlab sessions, not in a deployed program
38 if ~isdeployed % interactive Matlab session
39 if isWebpage % open in a web browser
40 str = [
'<a href="matlab:web(''-browser'',''' url
''');
">' label '</a>'];
41 else % Matlab command e.g. 'matlab:which(...'
42 str = ['<a href="' url '">' label '</a>'];
44 else % deployed (compiled)
45 if isWebpage && ~strcmp(label,url) % display label next to url
46 str = [label ' (' url ')'];
47 elseif isWebpage % text==url - display only the url
49 else % Matlab command (not a webpage) - just display the label
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
function hyperlink(in url, in label, in msg)
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...