Help text does not work for user-defined functions
古いコメントを表示
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.
help seems to work ok for built-in functions.
9 件のコメント
Are Mjaavatten
2020 年 1 月 18 日
stozaki
2020 年 1 月 18 日
I tried and got result correctly.Please refer my file attached.
As far as I could understand a similar question has been posted on MATLAB Answer. You can see the thread here and try to follow the solution give there. The error message displayed on the blank help page in that case is slightly different but I believe the solution should help in your case too.
Regards,
stozaki
Are Mjaavatten
2020 年 1 月 19 日
stozaki
2020 年 1 月 20 日
Which do you select Documentation Location? Installed locally or Web?
Please check your MATLAB preferences.
HOME > ENVIRONMENT Preferences > Help > Documentation Location.
Regards,
stozaki
Are Mjaavatten
2020 年 1 月 20 日
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
2020 年 1 月 21 日
編集済み: Are Mjaavatten
2020 年 1 月 21 日
Oli B
2020 年 3 月 20 日
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?
採用された回答
その他の回答 (1 件)
Mark Tiede
2020 年 4 月 19 日
1 投票
SOLVED – I had this problem as well: some (not all) user-written functions which used to show the correct documentation under r2018b would only show "<function_name> is a function" after updating to r2019b. In my case the problem (as suggested by Oli B) was Legacy Mac EOL encoding – after converting to Unix LF encoding the help for these problematic functions displayed correctly once again. Note that there are many ways to automate this conversion; see e.g. this page.
3 件のコメント
Are Mjaavatten
2020 年 4 月 20 日
編集済み: Are Mjaavatten
2020 年 4 月 20 日
Mark Tiede
2020 年 4 月 20 日
Did you check file encoding? What works for me under Windows is UTF-8 (EOL either \r\n or \n).
Are Mjaavatten
2020 年 4 月 20 日
カテゴリ
ヘルプ センター および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!