No help found for myfunc.m?
Mostrar comentarios más antiguos
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 comentarios
Star Strider
el 12 de Mzo. de 2014
Some of the path creation functions changed starting with in 2013b. (I have a startup.m file that adds all my directories to the MATLAB search path. I had to rewrite parts of it when I installed 2013b and noticed that none of my directories showed up.) I haven’t downloaded 2014a yet, so I don’t know if there have been other changes with it.
Sean de Wolski
el 12 de Mzo. de 2014
What's the output from:
which -all myfunc?
John
el 13 de Mzo. de 2014
Respuestas (4)
Azzi Abdelmalek
el 12 de Mzo. de 2014
1 voto
Check if your function is in the current folder
1 comentario
John
el 13 de Mzo. de 2014
Sean de Wolski
el 13 de Mzo. de 2014
Editada: Sean de Wolski
el 13 de Mzo. de 2014
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 comentarios
John
el 14 de Mzo. de 2014
John
el 14 de Mzo. de 2014
Image Analyst
el 14 de Mzo. de 2014
Try issuing the savepath command after you do those other commands.
Sean de Wolski
el 14 de Mzo. de 2014
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
el 12 de Mzo. de 2014
0 votos
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 comentarios
John
el 13 de Mzo. de 2014
Image Analyst
el 13 de Mzo. de 2014
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
el 1 de Abr. de 2020
0 votos
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
- Cd'd to directory of troubled.m
- Edited it in Matlab Editor
- Selected all text and closed the file.
- CMND-N for new file (Mac OS X).
- Pasted what I'd copied. Saved and OK'ed the overwrite of the troubled.m
- Typed help troubled
- 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).
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!