creating a three-dimensional array from three array with different size

1 次查看(过去 30 天)
a= 1 x 8 %double
b= 1 x 7 %double
c= 1 x 6 %double
How I can merge a,b,c into a single three-dimensional array with three pages and one column such as:
first page (1,1,1) = a
second page (1,1,2) = b
third page (1,1,3) = c

采纳的回答

KSSV
KSSV 2022-5-12
编辑:KSSV 2022-5-12
a = rand(1,8) ;
b = rand(1,7) ;
c = rand(1,6) ;
iwant = cell(3,1) ;
iwant{1} = a ;
iwant{2} = b ;
iwant{3} = c ;
iwant
iwant = 3×1 cell array
{[0.5613 0.0662 0.0848 0.5277 0.0531 0.5905 0.7043 0.5779]} {[ 0.5251 0.3192 0.9939 0.9976 0.5268 0.1235 0.5563]} {[ 0.0591 0.6501 0.5743 0.9299 0.5936 0.9937]}

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by