MATLAB: Combining variables into one variable

data combining

How to combine several variables into one variable? I have 28 variables with the same amount of data (tables 125×121) and I want to transform that into a one variable. Each variable is 125×121 double. I want to combine them all and get 28x125x121 double. How can I do that?

Best Answer

I'd like to throw the cat function into the discussion:
X=cat(3,S000_010,S010_S020,...);
To your question in the comment on David Sanchez answer: You have a comma too much in your parenthesis and the first = doesn't make sense. It should be X(1,:,:)=S000...
Best regards, Michael