create matrix again.....need help...please
Mostrar comentarios más antiguos
I have 2 matrices, A(10,10) and B(10,20). which have same size in row and different in column because matrix A consist of 10 variables, which each variables have different size in column. and the column size depend on user input (in matrix), if the input are [1 1 2 1 2 1 1 2 1 1] then matrix A have 13 column. matrix B also consist of 10 variables, column size in matrix B depend on user input either, if the input is 2 then each variables have the same size of column (2), and the total matrix B have 2*10=20 column.
Now,i wanna create matrix C which consist of A and B with the structure like this C=[A(:,1) B(:,1:2) A(:,2) B(:,3:4) A(:,3:4) B(:,5:6) A(:,5) B(:,7:8) A(:,6:7) B(:,9:10) A(:,8) B(:,11:12) A(:,9) B(:,13:14) A(:,10:11) B(:,15:16) A(:,12) B(:,17:18) A(:,13) B(:,19:20)].
this question is rather similar to my question before, but both matrice have the same size before.please help.
thanks in advance.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Resizing and Reshaping Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!