Access Keys:
Skip to content (Access Key - 0)

How can I load data into MATLAB from a text file?

You can load data into matlab using the "load" command. The data should be arranged just as you would want to appear in the matrix; for example, loading a file which contained:

	1.1   2.2    3.4
	2.2   3.3    2.3

would result in a two row, three column matrix.

The file should end in the extension ".dat". To load the file into a variable in matlab, you'd type something of the following form (substituting the path for your data) at the matlab prompt:

	load filename.dat

The data from the file will be loaded into the variable "filename".

IS&T Contributions

Documentation and information provided by IS&T staff members

Last Modified:

February 18, 2009

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
olc-matlab olc-matlab Delete
matlab matlab Delete
text text Delete
file file Delete
matlab-review matlab-review Delete
sam-duplicate sam-duplicate Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
This product/service is:
Easy to use
Difficult to use

This article is:
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki