Append an array inside a mat file without loading
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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!
0 commentaires
Réponses (1)
Fangjun Jiang
le 24 Oct 2011
The answer is no unless you've got the latest and greatest version of MATLAB.
0 commentaires
Voir également
Catégories
En savoir plus sur Structures dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!