How can i save a large structure array without performace issues?
8 ビュー (過去 30 日間)
古いコメントを表示
Stefan Wakolbinger
2020 年 9 月 8 日
回答済み: Stefan Wakolbinger
2020 年 9 月 23 日
Hello,
we are importing data with an .Net-dll into Matlab. The data will be saved in a structure like this.
for measure_id = 1:length(messungen)
...
for signal = 1:signal_names.Length
signal_name = signal_names(signal);
...
for RPC_Nr = 1:step.Length
for shot_idx ...
M(measure_id).ETCurve(ETC_Nr).(sprintf('%s', char(signal_name)))(shot_idx).data = DATA
end
M(measure_id).RPCurve(RPC_Nr).(sprintf('%s_t', char(signal_name))) = DATA
...
end
end
...
if measure_id < length(messungen)
save('data.mat', 'M', '-v7.3')
end
end
There are 6 different structure types for the "first level", like M(1).ETCurve, M(1).RPCurve, M(1).TP, ...
With this structure it is easy to acces the needed data like M(1).RPCurve(2).Q or M(1).ETCurve(2).U(100).data and so on.
One measurement has about 0,5 to 1,5 GB of data, when saved to a mat-file. After the 4th measurement saving and loading the workspace will take some time and after the 6th measurement it will take more than 30 minutes...
Has anyone an idea, wyh this will get so slow and can i improve the performance.
Tanks
5 件のコメント
per isakson
2020 年 9 月 8 日
To me it looks like you overwrite the variable named M in every iteration.
If each variable value is less than 2GB version, v7, is a faster alternative than v7.3
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!