Structures and cell arrays in MATLAB are implemented as arrays of pointers to other arrays. When a field or cell is changed only the pointer value for that cell or field is changed.
To produce the correct behavior (as if MATLAB had copied the values) MATLAB creates a shared data link with the array you place in the field. If you change part of that field later with a statement such as
a.data(3) = 5;
MATLAB does create a copy at that time (if the other array still exists).
The sequence of statements
r = rand(512);
a.data = r;
r = [];
a.data(3) = 5;
does all the work in place with no copies. On the other hand, the statements
r = rand(512);
a.data = r;
a.data(3) = 5;
will make a copy on the last statement.
Note that if your structure or cell array is linked to another, changing one field will require that the pointer array be copied (but not the data).