How to assambly two cells without for loop ?
Show older comments
Hello everybody,
I have an issue with the following: I have two cell arrays one is in a size of 24x1 (say UU1)and the other one is 8x1 (say UU2). I want to assamble these two in a third cell array with the size of 32x1 (say UU) without a for loop. It should look something like
UU{nodes1}=UU1; UU{nodes2}=UU2;
but could not do it :( Any help appreciated, thank you :)
3 Comments
mohammed
on 23 Jan 2014
Dear Ceren GURKAN;
i dont Know understand Your problem Exactly. but Suppose You have two cell in an example a,b of size 24 and 8 Respectivel.
a=cell(1,24);
for i=1:24
a{i}=randi(10,1,10); % a has size
end
b=cell(1,8);
for ii=1:8
b{ii}=randi(10,10,10);
end
c=[a,b];
Here the Size of C is 1X32; i hope it will help you.........
Ceren GURKAN
on 23 Jan 2014
Edited: Ceren GURKAN
on 23 Jan 2014
i think you just need only last line i.e c=[a,b];
i thought you already have 2 cell uu1 and uu the cell as you told
"I have two cell arrays one is in a size of 24x1 (say UU1)and the other one is 8x1 (say UU2)"
c=[UU1,UU2];
if not please tell me about your variable...
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!