MATLAB: Variables into a data structure

data_structurevariables

How can I add all the variables to the data structure?
I have 7 variables (all are the data matrices) and I want them in a single data structure.
There are the variables:
Name Value
Em 125×1 double
Ex 125×1 double
nEm 125
nEx 121
nSample 28
X 28x125x121 double
XBackup 28x125x121 double
I want them all in a data structure called OriginalData .
How can I do that?

Best Answer

OriginalData.Name = Name;
OriginalData.Em = Em;
OriginalData.Ex = Ex;
etc. etc.