How to assambly two cells without for loop ?

조회 수: 1 (최근 30일)
Ceren GURKAN
Ceren GURKAN 2014년 1월 23일
편집: mohammed 2014년 1월 23일
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
Ceren GURKAN
Ceren GURKAN 2014년 1월 23일
편집: Ceren GURKAN 2014년 1월 23일
Hi,
Thank you for the answer but what I want to do it without a for loop.If you can help me with that, that would be great :)
mohammed
mohammed 2014년 1월 23일
편집: mohammed 2014년 1월 23일
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...

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 23일
편집: Azzi Abdelmalek 2014년 1월 23일
n1=numel(uu1)
n2=numel(uu2)
Out=cell(1,n1+n2)
Out(1:n1)=uu1
Out(n1+1:n1+n2)=uu2
  댓글 수: 1
Ceren GURKAN
Ceren GURKAN 2014년 1월 23일
Thank you :) I was persistently using "{}" paranthesis rather than "()" do not know why :D it works perfectly now :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by