Matlab data extraction speed up
6 ビュー (過去 30 日間)
古いコメントを表示
Good day
I'm busy doing data extraction of a binary log file. The file is logged with various telemetry packets (with various classes with respective IDs).
I realised that reading a few bytes of the file at a time would be slow. So, what I did was read the entire file into a byte array. And then parse that byte array for the packets. This worked...
The problem is it is still slow.
I am pre-allocating memory and everything is stored in a multi-level struct called 'data'. An example data struct would be:
data.sensor.gps = some value. data.actuator.throttle.feedback = some other value. etc.
How can I speed this up? It takes about 13 minutes to extract a 40MByte file on my Intel Core 2 Duo with 4 Gigs of Ram.
I really need a solution in Matlab because my manager has requested I try doing in C as it will be faster.
Please help!!!
Amir
1 件のコメント
Oleg Komarov
2011 年 8 月 18 日
Without code is hard to guess and help. Also, try to profile the code to see where the bottleneck is.
回答 (1 件)
Friedrich
2011 年 8 月 18 日
Hi,
could you give us an example how the data is stored in the binary file? And how should the data look like in the end?
This question is a little bit too fuzzy to give a good answer.
Please give us more detailed information so we can safe you from using C ;)
2 件のコメント
Oleg Komarov
2011 年 8 月 18 日
Could be, but better profile the code for some files.
You can try to store it as:
data(1).sens
data(1).gps
data(1).lat
...
data(2).sens
data(2).gps
Where sens and gps constitute your combined ID.
参考
カテゴリ
Help Center および File Exchange で Image Data についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!