How to restore overloaded doc function?

3 views (last 30 days)
Robert
Robert on 2 Dec 2013
Commented: Robert on 3 Dec 2013
Hi,
I foolishly defined a variable called 'doc' in a Matlab script, which was left in the workspace after the script executed. I then attempted to use the 'doc' function to access the Matlab documentation. I get only an HTML version of the Matlab help contents, and those links don't seem to be active. Does anyone know how to bring the 'doc' function and Matlab help back to life?
Thanks for any suggestions. Bob
  1 Comment
Jan
Jan on 2 Dec 2013
Edited: Jan on 2 Dec 2013
What does this exactly mean: "I get only an HTML version of the Matlab help contents, and those links don't seem to be active."? Where did you get the HTML version after which command?
Did you restart Matlab already? Or clear doc?

Sign in to comment.

Answers (2)

Wayne King
Wayne King on 2 Dec 2013
Edited: Wayne King on 2 Dec 2013
I share Jan's puzzle as well, I would have expected a message like:
"Error: "doc" was previously used as a variable, conflicting with its use here as the name of a function or command."
but can't you just clear that variable
clearvars doc
Then if you enter
which doc
You should get something ending in
matlab\toolbox\matlab\helptools\doc.m

Robert
Robert on 2 Dec 2013
Sorry for my poor description. Normally the 'doc' function brings up the documentation in the familiar help window with a navigation pane on the left, containing contents and search tabs, and a reading pane on the right with help content (e.g., see first attached image below). After the flub I described, the 'doc' function now gives me a simple list containing links (e.g., second attached image below). If I select 'MATLAB' in the list, I get the second list shown. If I pick, say, 'Matlab functions' in the second window, it goes no further. This behavior persists after clearing everything, and even after restarting Matlab, or restarting the machine.
If I enter 'which doc', I do indeed get the path to doc.m as Wayne suggested. If I execute doc.m, I get the results I've described above. So, apparently 'overloading' is an inaccurate description of what I've done to my Matlab setup. Earlier in the event I did search for settings or preferences that might invoke the unusual behavior of the doc function, but couldn't find anything that seemed to help.
Hope this clears things up a bit. My apologies once again for the misleading description of my problem. Thanks for your interest.
Bob
  2 Comments
Sean de Wolski
Sean de Wolski on 3 Dec 2013
Does restarting MATLAB fix it? If not, contact support.
Robert
Robert on 3 Dec 2013
No, I have tried restarting Matlab, and even restarting the computer, and it is the same.
Thanks.

Sign in to comment.

Categories

Find more on Data Import and Export in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!