Best multi data type export options [table,struct,cell array, etc..] also file types
古いコメントを表示
I have a general question on exporting data to files and importing them in at a later date for processing. What would be an ideal class (struct, cell array, table etc) to export my data in under the following conditions:
- multiple data types, but all numeric (uint8, uint32, uint16, double, double, double)
- each "group" of data will be a 8x6 array
- would love to be able to assign header names to columns and maybe rows
- plan to use this as a mini database, will write a function to append a "group" of data to the current mini DB
- plan to write functions to do conditional processing (based on values in all the columns or just some) (ie. statistics etc)
- would like to use MATLAB to manage this "mini DB" (it will not extend past 10,000 groups of data anytime soon)
- I will have a standalone application constantly looping and adding the groups of data to the mini DB.
Currently the way I have it implemented is using the table class to write to and read from a .txt file. Pretty sure this isn't the optimal way to do this.
Did some research and it seems maybe cell arrays and .mat files would be the best approach?
回答 (1 件)
Peter Perkins
2018 年 8 月 3 日
0 投票
It's hard to say for sure, but it's likely that you don't want to use cell arrays, because that will make working with the data much more difficult. I don't know what you mean by "groups", but it seems like if you have mixed-type data that you want to attach names to, tables are the right thing to use. What kind of file you want to use depends on what you are doing with the files, but if you are reading/writing entirely from within MATLAB, a .mat file seems like a good choice.
カテゴリ
ヘルプ センター および File Exchange で Workspace Variables and MAT Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!