MATLAB Function Reference    

List file



type('filename') displays the contents of the specified file in the MATLAB Command Window. Use the full path for filename, or use a MATLAB relative partial pathname.

If you do not specify a filename extension and there is no filename file without an extension, the type function adds the .m extension by default. The type function checks the directories specified in the MATLAB search path, which makes it convenient for listing the contents of M-files on the screen. Use type with more on to see the listing one screenful at a time.

type filename is the unquoted form of the syntax.


type('') lists the contents of the file

type foo lists the contents of the file foo. If foo does not exist, type foo lists the contents of the file foo.m.

See Also

cd, dbtype, delete, dir, more, partialpath, path, what, who

  tsearchn uicontextmenu