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 CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by