Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

MATLAB doc Command: Open Documentation, Syntax and Offline Install

How the MATLAB doc command resolves names, what changed in R2024b, and how to install and verify offline documentation.

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.

  • doc opens the documentation in a new tab in your system web browser, and brings a hidden browser window to the foreground.
  • doc name displays 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

  1. On the Home tab, in the Environment section, click Settings (before R2025a: Preferences).
  2. In the left pane click MATLAB, then Help.
  3. Under Documentation Location, select Installed locally.
  4. Click Install Documentation. Files go to the support package root folder, which matlabshared.supportpkg.getSupportPackageRoot returns.
  5. 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

  1. Type doc abs to open the reference page for abs.
  2. For a class, use the class name: doc handle.
  3. For a method, separate names with periods: doc handle.findobj.
  4. For a class in a package, use doc containers.Map (form packageName.className, or packageName.className.name for a member).
  5. Run doc alone 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)

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about MATLAB doc Command: Open Documentation, Syntax and Offline Install

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →