transform matrices into a single matrix?
Show older comments
how I can transform matrices into a single matrix? I have 20 - 6x6 matrices, and I need to create 1 matrix for cluster analysis. Thanks!
5 Comments
KSSV
on 6 Oct 2016
what dimension of matrix you want at the end?
luca buonocore
on 6 Oct 2016
Marc Jakobi
on 6 Oct 2016
If you have 20 6x6 matrices, that's a total of 20*6*6 values = 720 values. In an output with 20 rows and 6 columns, you can only fit 120 values. Are you sure you want a 20x6 matrix?
luca buonocore
on 6 Oct 2016
KSSV
on 6 Oct 2016
Whats is the criteria for hierchical clustering..
Accepted Answer
More Answers (1)
elias GR
on 6 Oct 2016
Make a 3D matrix. If your 6x6 matrices are in the variables A1,A2,...,A20, then:
A=zeros(6,6,20);
A(:,:,1)=A1;
A(:,:,2)=A2;
...
A(:,:,20)=A20;
At the end all the matrices are inside 1 matrix as you wished, A.
3 Comments
luca buonocore
on 6 Oct 2016
elias GR
on 6 Oct 2016
Give us a specific numerical example of what you need
luca buonocore
on 6 Oct 2016
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!