Error loading multi-layered struct

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

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?

Sign in to comment.

Answers (0)

Asked:

on 17 Oct 2017

Commented:

on 17 Oct 2017

Community Treasure Hunt

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

Start Hunting!