earGrowth
earGrowth

Reputation: 791

Display contents of text file in MATLAB shell

I'm using MATLAB under Windows, and trying to display (dump) the contents of a text file in the command shell. It seems like overkill to open a small file in the editor, or to load the file to use disp.

Upvotes: 1

Views: 1694

Answers (2)

Edric
Edric

Reputation: 25140

As well as type, there's also dbtype which lets you pick a start and end range to print, and shows line numbers - handy for listing source files.

Upvotes: 0

Eitan T
Eitan T

Reputation: 32930

Use type and specify the explicit file name (including the extension), for instance:

type('myfile.txt')

Upvotes: 6

Related Questions