I am trying to save and load structure arrays in a MAT-file, but the structure array keeps changing every time I reload it. If save the following and reload it, it keeps adding struct in front.
struct.field1
struct.field2
save data.mat struct
struct = load('data.mat');
I know that this is happening because I load the file in a variable which makes it a struct and that it won't if I use only:
load('data.mat')
However I am calling the load command within a function and therefore I cannot use this. Does anyone have an idea how to solve this, so that I don't get:
struct.struct.struct.struct.struct.field1;
struct.struct.struct.struct.struct.field2;
after couple of times reloading the data.mat file, but just this:
struct.field1;
struct.field2;
Kind regards,
Romano