Extracting data from a text file into an array

1 次查看(过去 30 天)
I have a file filled with day by day temperature maxima's for 40 years. Each day shows the max temperature for 500 or so grid points. I am attempting to firstly call this file in Matlab then select the largest value for each grid point from each month. If anyone could give me some pointers or sources to use to solve this it would be much appreciated. I have tried using multiple different websites and other peoples forums to help me but have made no progress. (I'm new). Thanks for any help it is much appreciated.
Sample of data is shown bellow: 2011 9 11 298.400 298.700 299.100 299.500 299.700 299.700 299.600 299.500 299.200 299.300 299.800 299.700 299.300 299.000 299.100 299.700 300.900 301.700 296.800 295.400 297.400 299.300 300.900 301.600 301.700 301.500 298.700 298.700 299.000 299.300 299.100 298.900 299.200 299.200...... {these values continue for the 500 grid points}
2011 9 12 298.800 299.000 299.400 299.800 299.700 299.500 299.500 299.200 299.200 299.300 299.900 299.700 299.200 299.000 299.100 299.700 300.500 300.700 296.500 295.200 297.200 299.600 301.200 302.100 302.000 301.700 298.800 298.800 299.100 299.300 299.000 298.900 299.200 299.300 299.300........
Year 2011, Month 09, Day 11 -> 12

回答(2 个)

Azzi Abdelmalek
Azzi Abdelmalek 2016-8-9
M=dlmread('filename.txt')

Stalin Samuel
Stalin Samuel 2016-8-9

类别

Help CenterFile Exchange 中查找有关 Data Import and Export 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by