For example, I have 6 similar Matrices (Matrix A1 to A6) but with different data.
Matrix A1:
2011/1/1 23.00 33.00 23.00 35.00 …
2011/1/2 19.00 20.00 22.00 22.00 … …
I want to combine these 6 Matrices and create a new Matrix B.
The Matrix B will have: 6 columns and the length of the row equals (length(column of A)-1).
The first column of Matrix B is Matrix A1’s first row (exclude date).
The second column of Matrix B is Matrix A2’s first row (exclude date)…and so on…
I am looking for a script. Thanks!
or
UPDATE:
Instead of having multiple matrices with different names consider using cell array where each cell contains a matrix. If
Ais a cell array,then you can access k-th matrix as
A{k}. In this case you may have different number of matrices in the cell array and get B in a vectorized manner using, for example, this code: