Extract data from large file

3 ビュー (過去 30 日間)
Paul
Paul 2011 年 10 月 26 日
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

採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 10 月 26 日
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)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by