Append an array inside a mat file without loading

4 ビュー (過去 30 日間)
Steve
Steve 2011 年 10 月 24 日
Hello, I was wondering if anybody knew of a way to append an array (in this case, a struct array) that has been saved to a mat file without loading the array into memory first. Here's a simple example of what I mean:
1) Create a struct array in a .mat file:
myStruct(1).name='Measurement2'; myStruct(1).type='double'; myStruct(1).value=2.3; myStruct(2).name='Setting'; myStruct(2).type='text'; myStruct(2).value='High'; save('myFile', 'myStruct')
2) Do other things (close Matlab, have coffee, load new data)
3) Look at new data
newStruct.name='Color'; newStruct.type='text'; newStruct.value='Blue';
...how could this get saved as an append to myStruct (e.g. myStruct(3)) inside myFile.mat? The -append switch on the save function causes the entire myStruct array to be replaced by the new one, which I do not want.
Any help is greatly appreciated, thanks!

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 10 月 24 日
The answer is no unless you've got the latest and greatest version of MATLAB.

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by