Documentation

dbtype

Display file with line numbers

Syntax

dbtype filename
dbtype filename start:end

Description

example

dbtypefilenamedisplays the contents offilenamewith line numbers preceding each line. This is helpful when setting breakpoints in a program file withdbstop. You cannot usedbtypeto display the source code of built-in functions.

example

dbtypefilenamestart:enddisplays the portion of the file starting at line numberstartand ending at line numberend. To display a single line, you can specify only thestartvalue.

Examples

collapse all

Display the example filebuggy.mwith line numbers preceding each line.

dbtypebuggy
1 function z = buggy(x) 2 n = length(x); 3 z = (1:n)./x;

查看输入和输出参数uments for an example function,buggy, by displaying the first line of the file. Sincestartandendare the same in this case, you can omit theendvalue.

dbtypebuggy1
1 function z = buggy(x)

Input Arguments

collapse all

File name, specified as a character vector. The file name can be a partial path, but must be in a folder on the search path or in the current folder. Otherwise, specify the full path name.

Starting line number, specified as a positive integer.

Ending line number, specified as a positive integer.

Introduced before R2006a

Was this topic helpful?