No help found for myfunc.m?

조회 수: 4 (최근 30일)
John
John 2014년 3월 12일
답변: Terrance Nearey 2020년 4월 1일
I just downloaded 2014a and tested it. It works EXCEPT the help command doesn't work, or at least it doesn't work the way it used to. I have a function like:
function f = myfunc( a, b )
%MYFUNC does cool stuff
%
% f = MYFUNC( a, b )
%
% ...
When I type 'help myfunc', I get the message 'No help found for myfunc.m'.
I went back and tested help under matlab 2012a and it works fine. Did something change in versions 2014a (or 2013*)? Any idea what is going on?
  댓글 수: 3
Sean de Wolski
Sean de Wolski 2014년 3월 12일
What's the output from:
which -all myfunc?
John
John 2014년 3월 13일
The file is in the current folder, and shows on the left pane.
which -all myfunc shows the current folder

댓글을 달려면 로그인하십시오.

답변 (4개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 3월 12일
Check if your function is in the current folder
  댓글 수: 1
John
John 2014년 3월 13일
It is in the current folder.

댓글을 달려면 로그인하십시오.


Sean de Wolski
Sean de Wolski 2014년 3월 13일
편집: Sean de Wolski 2014년 3월 13일
Run the following to reset the path in 14a to the default in case you have your own pathdef.m file:
restoredefaultpath
rehash toolboxcache
This fixes the issue.
  댓글 수: 4
Image Analyst
Image Analyst 2014년 3월 14일
Try issuing the savepath command after you do those other commands.
Sean de Wolski
Sean de Wolski 2014년 3월 14일
Yes, John, savepath while running MATLAB as an admin (priviledges can be needed sometimes).
As for where myfunc is has nothing to with it, as long as it's on the path. The path that's missing is a folder that help requires internally. Since MATLAB copied your custom pathdef.m file, it did not update some of these folders since it just copied everything over. I know this can be frustrating.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2014년 3월 12일
Are you sure you saved the file after you added the help lines and tried the help myfunc command? If you haven't save it yet, it won't see the help lines yet. And are you in the same folder as myfunc or at the very least myfunc is on the search path?
  댓글 수: 2
John
John 2014년 3월 13일
The same file ha been used for over 5 years. Yes, I'm in the same folder. The exact same situation works fine on 2012a.
Image Analyst
Image Analyst 2014년 3월 13일
Well I just copied and pasted your code into a new script and saved it as myfunc.m and typed "help myfunc" on the command line and it worked fine . So, since it's just you John , you'll have to call the Mathworks.

댓글을 달려면 로그인하십시오.


Terrance Nearey
Terrance Nearey 2020년 4월 1일
I was having similar problems with a couple of old functions in a subdirectory with lots of home grown functions.
After reading https://www.mathworks.com/matlabcentral/answers/121218-no-help-found-for-myfunc-m#comment_201719, I decided to try copying and pasting of my own files:
Let's call the problem file 'troubled.m'
When I started, and I typed help troubled, I got only the message "troubled is a function." Then I did the following
  1. Cd'd to directory of troubled.m
  2. Edited it in Matlab Editor
  3. Selected all text and closed the file.
  4. CMND-N for new file (Mac OS X).
  5. Pasted what I'd copied. Saved and OK'ed the overwrite of the troubled.m
  6. Typed help troubled
  7. Help showed up as expected. All was fixed.
Same process worked on several files. Perhaps there are some bad characters in the file that this somehow purges? (The function worked fine both before and after the help problem was solved).

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by