Extract data from large file

5 Ansichten (letzte 30 Tage)
Paul
Paul am 26 Okt. 2011
I've got a very large (50 mB) .mat file with results from a 15 year, 6h run of wave hindcast in various geographical points.
The .mat file is organized in 3 colummns (in which the first two colummns are the geografical location x and y(eg: 37.1234N and 7.67363W), and the 3rd is the parameter I'm interested in) and I want to extract to a file only the data concerning 15 years for only two specific points.
. .
. .
37.4321 8.9823 5
37.4321 8.9850 7
*37.1234 7.6763 8*
. .
. .
37.4321 8.9823 8
37.4321 8.9850 3
*37.1234 7.6763 5*
. .
. .
That means I'll have a smaller file with the same data but only for two points
Any Idea?
Thank you
Paul

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 26 Okt. 2011
Use the example below. Be careful about the Data(:,1)==37.1234 comparison though as it involves floating point. You may need to use abs(Data(:,1)-37.1234)<eps instead.
Data=[37.4321 8.9823 5
37.4321 8.9850 7
37.1234 7.6763 8
37.4321 8.9823 8
37.4321 8.9850 3
37.1234 7.6763 5];
Index=and(Data(:,1)==37.1234,Data(:,2)==7.6763);
MyData=Data(Index,3)

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by