Written and maintained by CASRAI Editorial Board
Last updated
The MATLAB doc command opens the official MathWorks documentation in your system web browser; doc name jumps straight to the reference page for a function, class or other item. This guide is for researchers and analysts who want to look things up from the Command Window, get the documentation working offline, or understand why doc sometimes shows a search page or the wrong version. Facts below are from the MathWorks doc reference page and installation guides (read 2026-11-07).
What doc is used for in research
Analysis code leans on function reference pages: input arguments, name-value options and defaults that belong in a methods section. doc gets you there without leaving the Command Window.
docopens the documentation in a new tab in your system web browser, and brings a hidden browser window to the foreground.doc namedisplays documentation for a function, class, block or other item.
Since R2024b the documentation opens in the system web browser instead of the Help browser, which was removed. Older tutorials that describe the Help browser describe earlier releases.
Install or access (official source only)
With internet access, doc opens the pages on mathworks.com and needs no setup. To read the documentation without a connection, install it locally.
Install documentation on a connected computer
- On the Home tab, in the Environment section, click Settings (before R2025a: Preferences).
- In the left pane click MATLAB, then Help.
- Under Documentation Location, select Installed locally.
- Click Install Documentation. Files go to the support package root folder, which
matlabshared.supportpkg.getSupportPackageRootreturns. - Restart MATLAB, then enter
doc.
Repeat the steps after adding or removing products, or to get the latest documentation. To switch back, select Web, on mathworks.com under Documentation Location and restart MATLAB.
Install on a permanently offline computer
MathWorks supports this on Windows and Linux with MATLAB already installed and more than 10 GB free on both computers. Download the documentation ISO (it needs a MathWorks Account) on a connected computer, copy it across, mount it, and run the installer from Command Prompt or Terminal, not from MATLAB:
cd <mountedDocImage>/bin/<arch> .mpm.exe install-doc --matlabroot="C:Program FilesMATLABR2026b"
On Linux the command is ./mpm install-doc --matlabroot=/home/<username>/matlab. Add --destination with a full path for a custom location. Then, in MATLAB:
s=settings, s.matlab.help.DocLocation.PersonalValue='INSTALLED';
For a custom destination also run docroot('<custom/doc/install/folder>/help'). You can put these lines in startup.m or matlabrc.m. Restart MATLAB afterwards.
Step-by-step: look up a function with doc
- Type
doc absto open the reference page forabs. - For a class, use the class name:
doc handle. - For a method, separate names with periods:
doc handle.findobj. - For a class in a package, use
doc containers.Map(formpackageName.className, orpackageName.className.namefor a member). - Run
docalone to open the documentation home page.
Events, properties and some methods need the class name. Some class methods cannot be opened with doc; use the links on the class reference page instead. The name argument may also be an operator symbol.
How doc name resolves a name
| Order | What doc looks for | What you see |
|---|---|---|
| 1 | A MathWorks product named name |
The product’s main documentation page |
| 2 | A reference page | That page (third-party or custom HTML documentation is not shown) |
| 3 | Help text in name.m or name.mlx |
The help text |
| 4 | None of the above | Documentation search results for name |
This order explains most surprises: a toolbox name opens the product page rather than a function, and a name with no reference page falls through to search.
Output and how to read it
For a built-in function or class you get the full reference page in the browser. Read the address bar to tell local from web documentation: http://127.0.0.1: followed by a port number means the installed copy is open, while https://www.mathworks.com/help/... means the web documentation is. For your own code, doc shows the help text from your file in a separate window: doc sads displays formatted help text for a custom class defined in sads.m, and doc sads.steer displays the help for its steer method. For writing functions see declaring a function in MATLAB.
Troubleshooting
doc opens the web instead of local files
Check the address as above. If it shows mathworks.com when you expected the local copy, set Documentation Location to Installed locally (or run the DocLocation command), then restart MATLAB.
doc name shows search results
No reference page or help text exists for that name, so step 4 of the lookup order ran. Check the spelling and the package or class prefix.
Third-party or custom documentation does not appear
Open the documentation home page, click Supplemental Software on the left, then click the documentation you want.
A property or event will not open
Use doc className and follow the links on the class page.
Free alternatives
GNU Octave, a free MATLAB-compatible environment, has its own help system (GNU Octave manual, Getting Help page, read 2026-11-07). To compare the two for analysis work, see MATLAB vs R.
| Command | In Octave |
|---|---|
help NAME |
Shows the help text for NAME |
doc FUNCTION |
Opens the manual entry for the function in the GNU Info browser |
lookfor STR |
Searches the first sentence of function help; -all searches the full text |
FAQ
Is there a MATLAB documentation download?
Yes, for local use: the Install Documentation button on a connected computer, or the documentation ISO for permanently offline computers, both described above. Either way you open it with doc in a browser.
How do I check whether I am reading local or web documentation?
Run doc and read the browser address: a 127.0.0.1 address is local, a mathworks.com address is the web copy.
What does doc show for a function I wrote myself?
If no MathWorks reference page matches, doc displays the help text in your .m or .mlx file.
Where next?
Try doc on commands you meet, for example reshape, and see plot labels and MATLAB and Simulink.
Sources (official docs)
- MathWorks: doc, read 2026-11-07.
- MathWorks: Install Documentation Using Internet Connection, read 2026-11-07.
- MathWorks: Install Documentation on Offline Machines, read 2026-11-07.
- GNU Octave: Getting Help, read 2026-11-07.







