List text file with line numbers


dbtype filename
dbtype filename start:end


The dbtype command is used to list a text file with line numbers, which is helpful when setting breakpoints in a MATLAB® code file with dbstop.

dbtype filename displays the contents of the specified text file, with the line number preceding each line. filename must be the full path name of a file, or a MATLAB relative partial path.

dbtype filename start:end displays the portion of the file specified by a range of line numbers from start to end.

You cannot use dbtype for built-in functions.


To see only the input and output arguments for a function, that is, the first line of the file, use the syntax

dbtype filename 1

For example,

dbtype addpath 1


1     function oldpath = addpath(varargin)
Was this topic helpful?