Resolving name clashes with builtins in a see also documentation section

59 Views Asked by At

I have the following class, with a method that hides (or shadows) a builtin function. I want the documentation to contain a "See Also" section, that links to the builtin function that is hidden.

classdef CatHelper
  %CATHELPER Makes implementing vertcat/horzcat easy on a custom class
  %
  %   See Also: cat

  methods (Abstract)
    obj = cat(obj, ndim, varargin);
  end
end

Unfortunately, the "see also" link just tries to give help on the undocumented abstract method CatHelper/cat.

How do I specify that I want the link to go to the builtin cat function?

2

There are 2 best solutions below

0
On BEST ANSWER

After playing around a bit with doc.m\resolveTopic(), I came up with the three options as shown below. The top one (\cat) gives the best result, but you should use whichever you feel is the least ambiguous in your case.

%   See Also: \cat
%   See Also: elmat\cat
%   See Also: matlab\elmat\cat

These were found by passing topic = 'cat' into:

matlab.internal.language.introspective.resolveName(topic, '', false);
0
On

One slightly ugly workaround is to just include a direct link:

%   See Also: <a href="matlab:help cat">cat</a>