MATLAB Answers

Help text does not work for user-defined functions

16 views (last 30 days)
Are Mjaavatten
Are Mjaavatten on 18 Jan 2020
Commented: Oli B on 20 Mar 2020 at 10:00
I just installed R2019b and the help function does not work. Example: I created the addme function from the Add Help for Your Program page in the documentation. Result:
>> help addme
addme is a function.
c = addme(a, b)
The help text in the file was not shown. Also:
>> help help
help not found.
A similar question was asked before, but the answer was not very helpful for me.
help seems to work ok for built-in functions.

  9 Comments

Show 6 older comments
stozaki
stozaki on 20 Jan 2020
Did following command work fine for you?
which help
If the return value of this command is not the absolute path of the help function, the help function is off the MATLAB search path.
Are Mjaavatten
Are Mjaavatten on 21 Jan 2020
>> which help
C:\Program Files\MATLAB\R2019b\toolbox\matlab\helptools\help.m
In R2014, where help works ok, the help text is created in line 55 of:
C:\Program Files\MATLAB\R2014b\toolbox\matlab\helptools\+HelpUtils\@helpProcess\getTopicHelpText.m:
[hp.helpStr, hp.needsHotlinking] = builtin('helpfunc', '-casesensitive', hp.topic, '-hotlink', hp.command);
In the correponding file in R2019, the help text is created in line 68:
getAlternateSourcedHelp(hp, [], justH1);
Oli B
Oli B on 20 Mar 2020 at 10:00
I have a similar problem with Matlab R2019a. I use functions that were written in previous versions of Matlab (2014 I think). I can use them, but when I try to get a function's help all it gives me is "myfunction is a function".
If I copy a function's code in a new script and save it from Matlab R2019a, it works correctly. So it is not a mistake in the function's code nor in the help's path. It looks like some kind of encoding error or incompatibilty between versions?
How can I solve this without having to resave 100+ functions?

Sign in to comment.

Answers (0)

Sign in to answer this question.

Tags


Translated by