How I can combine this cell values in a single matrix?
1 view (last 30 days)
Show older comments
%20matrix.jpeg)
How I can get in a single (12X28) matrix
Answers (2)
Simon Chan
on 17 Aug 2021
Edited: Simon Chan
on 17 Aug 2021
Something like this and final matrix is C
clear; clc;
X = cell(1,4);
X{1} = round(10*rand(1,7));
X{2} = round(10*rand(3,7));
X{3} = round(10*rand(2,7));
X{4} = round(10*rand(2,7));
B{1} = repmat(X{1},12,1);
B{2} = repmat(kron(X{2},ones(2,1)),2,1);
B{3} = repmat(X{3},6,1);
B{4} = kron(X{4},ones(6,1));
C = cell2mat(B);
2 Comments
Simon Chan
on 17 Aug 2021
Need to know the pattern how to repeat the matrix. If a pattern can be found, it is able to implement it in a loop.
However, I am also confused since the repeating method of a 2 rows matrix may be different (The left and right matrix in your elaboration).
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!