Append an array inside a mat file without loading

9 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Structures 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by