Create an array from others matrix
显示 更早的评论
I need to put "a" matrix one below the other in a single matrix. That is, I need to place in a matrix of dimension a*b x N, where the first b rows correspond to sec=1, from row b+1 to row 2b+1 the second matrix corresponding to sec=2, and so on.
For example for this code:
a=100;
b=5;
N=8;
for sec=1:a
PM=rand(b,N)
end
I want to create the matrix of dimension 500x8, formed by the 100 matrix generated, where the first 5 rows correspond to the matrix obtained for sec = 1, from row 6 to row 11 the second matrix corresponding to the matrix obtained for sec = 2, and so on.
3 个评论
Bob Thompson
2019-10-14
编辑:Bob Thompson
2019-10-14
Why do you want 6-11 to be for 2sec? There were only five rows for the first second.
Where is your data coming from? Or is it just randomly generated numbers?
Assuming that you have data, I would use something like the following:
for i = 1:100
data((i-1)*5+1:i*5,:) = rand(5,8);
end
Romina
2019-10-14
Bob Thompson
2019-10-14
Ok, well the indexing on 'data' should be what you're looking for. I can't write the right hand side of the equation for you because I don't know what it looks like.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!