We want to save data as it is generated, and to save it as a .mat file. Since every trial can be of a different length, a simple matrix will not suffice.
We have the following two options:
cell_data.x{1} = randn(1e4,1);
cell_data.y{1} = randn(1e4,1);