About trasfor two dimensions to three dimensions
2 ビュー (過去 30 日間)
古いコメントを表示
I want to ask a simple question,but I just can't solve it.
My data follow below
A=(23*25). B=(23*25)
Then I want to change A & B to C=(6*23*25)
The c(1,:,:),c(2,:,:)and c(3,:,:)are A
The c(4,:,:),c(5,:,:)and c(6,:,:)are B
How can I use loop or something to make it happen?
Thanks
採用された回答
Marc Jakobi
2016 年 10 月 9 日
I assume 23*25 are the dimensions of the matrices?
You could do something like this:
c = zeros(6, 23, 25);
c(1:3,:,:) = permute(repmat(A,1,1,3),[3,1,2]);
c(4:6,:,:) = permute(repmat(B,1,1,3),[3,1,2]);
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!