How can i concatenate array of 3 to form single matrix?
Show older comments
i am very new to matlab, so sorry if i sounded stupid
i just need to get an output of 3 array from my looping and form one single 3d matrix
for example
100 array x 10 array x 12 array and store it as 3d matrix
so that the size will be : 100 x 10 x 12
any idea?
and thank you in advanced
1 Comment
Jan
on 29 Jan 2017
An important detail is missing: I assume "100 array" means a vector of the size [1 x 100] or [100 x 1]. Then combining these vectors need to apply a mathematical operation, multiplication or addition etc. Please post some example input data and the wanted output, e.g. with the sizes 2,3,4.
Accepted Answer
More Answers (1)
Andrei Bobrov
on 29 Jan 2017
[xx,yy,zz] = ndgrid(x,y,z);
res = xx+yy+zz
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!