anonymous
anonymous

Reputation: 1

reading ascii file in matlab

I have a .ascii file as below for 1980-2010: How can I choose the data from ANOM4 column and corresponding month(MON), without the header, using matlab?

YR   MON  value1  ANOM1   value2    ANOM2  value3   ANOM3  value4  ANOM4 

1980   1   24.57   -0.15   26.18    0.38   28.62    0.28   27.15    0.44 

1980   2   25.84   -0.34   26.57    0.03   28.51    0.31   27.10    0.22
...

I tried fileread(filename) but that is displaying the whole file. Any suggestion would be helpful! Thanks in advance!

Upvotes: 0

Views: 615

Answers (1)

Mahesh Kumar Kodanda
Mahesh Kumar Kodanda

Reputation: 291

Have you tried Matlab Import Data button? Go to Home tab-> in the Variable section-> select Import Data.

Select the file whichever you want to import, and get whichever row or column you want from imported data.

OR right click the name of the file in the Current Folder browser and select Import Data. The Import Tool opens.

it is possible to create variables also in your Matlab workspace.

Source:

http://www.mathworks.com/help/matlab/import_export/import-data-interactively.html

Upvotes: 1

Related Questions