"help" does not work
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I noticed this in R2025B. "help <myfunction>" just displays two blank lines, not the comments on top of <myfunction.m>. This m-file is in a directory at the beginning of my path.
채택된 답변
Matt J
2025년 11월 4일
1 개 추천
댓글 수: 27
Ravi
2025년 11월 4일
Thanks. When I type "wihch help" I get
C:\Program Files\MATLAB\R2025b\toolbox\matlab\helptools\help.m
seems like the legitimate one. Is it not the right one?
Torsten
2025년 11월 4일
Same for
which help -all
/MATLAB/toolbox/matlab/helptools/help.m
?
seems like the legitimate one. Is it not the right one?
It's the right one, but it is not what I was talking about. You have to open help.m and step through the code inside it line by line, until you see it call a function you recognize as one of your own personal mfiles.
It may also be helpful to test help() after activating the debugger with,
>>dbstop if caught error
from the command line.
Do you have the same problem when you use doc()?
Another, perhaps easier thing to try is restoredefaultpath, which will set the path back to its default state. Do this and see if help() works normally.
Thanks for all your suggestions. Nothing works!
- There is no error when using "help"
- It works fine with all functions except those I have defined myself.
- restoredefaultpath does nothing.
- "doc <myfunction>" takes forever to return to a prompt. It opens a browser window with blank lines.
- "doc <matlabfunction>" opens the help for that function in a browser window.
Steven Lord
2025년 11월 5일
Please attach one such myfunction.m file with which you see this behavior. It's possible, given that you said "It works fine with all functions except those I have defined myself.", that there's something about the way you defined your help text in those files that causes help to display just blank lines.
Please attach the file rather than quoting it here, in case there's some non-printable characters (that appear as blanks / spaces) introduced by say writing the code in Microsoft Word and having it formatted by that program.
Ravi
2025년 11월 5일
Here you are. I just created this in the MATLAB editor just to make sure it is a text file.It is in the current directory and I can run it. But "help" returns nothing.
Do you get the same output as below if you type
dbtype 'C:\Program Files\MATLAB\R2025b\toolbox\matlab\helptools\help.m'
for the first five lines of "help.m" on your computer ?
dbtype '/MATLAB/toolbox/matlab/helptools/help.m' 1:5
1 function [out, docTopic] = help(varargin)
2 % Help is helpful!
3 cleanup.cache = matlab.lang.internal.introspective.cache.enable; %#ok<STRNU>
4
5 process = matlab.internal.help.helpProcess(nargout, nargin, varargin);
Yes I got the same output as you. .
Of course, I had to change the path from your example. I typed:
dbtype 'C:\Program Files\MATLAB\R2025b\toolbox\matlab\helptools\help.m' 1:5.
Steven Lord
2025년 11월 5일
dbtype 1:10 myfunction.m
1 function [out] = myfunction(in)
2 %
3 %[out] = myfunction(in)
4 %
5 % This is to test out help
6 %
7 %
8
9 out = in;
10
help myfunction
[out] = myfunction(in)
This is to test out help
To confirm, this is not the behavior you see on your machine for those two commands? Can you run that on your machine and copy and paste the output into a comment here?
Torsten
2025년 11월 5일
And if you save the file "myfunction.m" as "myfunction.m" in your working directory and type
help myfunction.m
[out] = myfunction(in)
This is to test out help
blank lines are displayed - in contrast to what you get here ? Then either there is a second file "help.m" on your MATLAB path or the "help.m" under C:\Program Files\MATLAB\R2025b\toolbox\matlab\helptools\help.m is corrupted.
Ravi
2025년 11월 5일
>> dbtype 1:10 myfunction.m
1 function [out] = myfunction(in)
2 %[out] = myfunction(in)
3 %
4 % This is to test out help
5 %
6 %
7
8 out = in;
9
Ravi
2025년 11월 5일
I removed the top comment line
Ravi
2025년 11월 5일
>> help myfunction.m
>>
Ravi
2025년 11월 5일
>> which help
C:\Program Files\MATLAB\R2025b\toolbox\matlab\helptools\help.m
Ravi
2025년 11월 5일
>> dbtype help
1 function [out, docTopic] = help(varargin)
2 % Help is helpful!
3 cleanup.cache = matlab.lang.internal.introspective.cache.enable; %#ok<STRNU>
4
5 process = matlab.internal.help.helpProcess(nargout, nargin, varargin);
6 if isnumeric(process.inputTopic)
7 process.inputTopic = inputname(process.inputTopic);
8 end
9
10 try %#ok<TRYNC>
11 % no need to tell customers about internal errors
12
13 process.callerContext = matlab.lang.internal.introspective.IntrospectiveContext.caller;
14
15 process.getHelpText;
16
17 process.prepareHelpForDisplay;
18 end
19
20 if nargout > 0
21 out = process.helpStr;
22 if nargout > 1
23 docTopic = process.docLinks.referencePage;
24 if isempty(docTopic)
25 docTopic = process.docLinks.productName;
26 end
27 end
28 end
29 end
30
31 % Copyright 1984-2023 The MathWorks, Inc.
Ravi
2025년 11월 5일
>> help help
help - Help for functions in Command Window
This MATLAB function displays the help text for the functionality
specified by name, such as a function, method, class, toolbox, variable,
or namespace.
Syntax
help name
help
Input Arguments
character vector | string scalar
Examples
Introduced in MATLAB before R2006a
What if you copy the function "help.m" from C:\ProgramFiles\MATLAB\R2025b\toolbox\matlab\helptools\ to your working directory and then execute
help("myfunction.m")
[out] = myfunction(in)
This is to test out help
? If this doesn't work, I think you will have to reinstall MATLAB R2025b.
If this doesn't work either, contact MATLAB Technical Support:
Ravi
2025년 11월 5일
That did not help either! I guess I will try and reinstall MALAB! What a pain!
Torsten
2025년 11월 5일
You checked whether the system requirements for MATLAB R2025b are fulfilled for your computer ?
Ravi
2025년 11월 5일
As I suspected. I wasted time reinstalling it and it still has the same problem! Yes, the computer supports these requirements. Thanks for your help.
Oh well, maybe somebody from Mathworks can help. I have another computer on which I will install it and see if it has the same problem. Obviously it worked fine for you, so maybe there is something peculiar about this specific computer!
Ravi
2025년 11월 5일
I have reached out to Tech Support. Let's see if they can help.
If they are successful finding the cause of the problem, please report their solution here to help other MATLAB users with the same problem.
Ravi
2025년 11월 7일
They haven't been able to find anything yet. The one thing they asked me to do was to run
>>ver -support
I got this: "Java Version: Java is not enabled" as one of the responses. I wonder if that is a problem? Also, as a test, I installed MATLAB on a completely different computer. A DELL instead of an HP. I got the same issue, i.e., "help" not working for myfunction.
Let's see if Mathworks can get to the bottom of this...
By the way, "doc myfunction" does not show anything. At least when I click on "View code for myfunction.m" I see the function text, which means it is pointing to the right function.
Finally figured it out. You all were essentially right. There was another function that was being called by mistake.
I had written a function called "strip" which was in the current directory and was being called. It seemed to be so well written that it funcitoned perfectly and stripped all the output of the "help" function without throwing any errors.
MATHWORKS support did their best to help me. While corresponding with them, I figured this out. Once I removed my "strip" function from the path, "help" is working as expected.
Thanks
In my defense, my "strip" is from the 1990s, while MATLAB's "strip" is from 2016. So, that is why it worked before. :-)
Matt J
2025년 11월 14일
Finally figured it out. You all were essentially right. There was another function that was being called by mistake.
If so, please Accept-click the answer to indicate to others that this was correct.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
참고 항목
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

