Error loading multi-layered struct
Show older comments
I have a 'database' which consists of a series of structs within structs within structs, supposedly containing various numeric and and string fields and arrays. This is saved as T2database.mat and has always loaded into my workspace using: load('T2database.mat').
Now when I load it, the DATABASE comes up empty. The structure of it should be:
DATABASE.Data{1}.DATA.#SOME_FIELD etc.
The 'Data' layer should contain a struct for each subject, but is presenting as an empty array.
This applies to all the backups of the database file, and occurs on various versions of MATLAB. I have updated neither MATLAB or the Database, and have no idea what could have caused this!
Any ideas welcome. I've attached the Database for you to have a play with. Happy to provide any more details about the problem.
Thanks
1 Comment
OCDER
on 17 Oct 2017
It's weird. I also get an empty structure with
DATABASE.Data = 1x137 empty cell
DATABASE.MyDatabase = {'MyDatabase'}
The size of DATABASE is only 1580 bytes. In comparison rand(14) uses 1568 bytes. So there really is nothing there...
Perhaps the code that saves the database didn't actually save the database, but only the initialized empty ones?
Answers (0)
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!