L=(length(time)-1);
for q=1:numPT
for h=1:L
x(q,h)=SortDate(q,5);
y(q,h)=SortDate(q,6);
c(q,h)=SortDate(q,4);
end
end

댓글 수: 1

pg
pg 2017년 8월 9일
what if its changed to this?
L=(length(time)-1);
for q=1:numPT
for h=1:L
x(q,h)=SortDate{q+numPT*(h-1),6};
y(q,h)=SortDate{q+numPT*(h-1),7};
c(q,h)=SortDate{q+numPT*(h-1),5};
end
end

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

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2017년 7월 21일
편집: Andrei Bobrov 2017년 7월 21일

1 개 추천

cxy = permute(repmat(SortDate(q,4:6),1,1,L),[1 3 2]);
here cxy your arrays c,x and y as cxy = cat(3,c,x,y)

댓글 수: 2

pg
pg 2017년 7월 21일
It works Thanks so much !!
pg
pg 2017년 8월 9일
what if the question is changed to this how can I replace the for loops?
L=(length(time)-1);
for q=1:numPT
for h=1:L
x(q,h)=SortDate{q+numPT*(h-1),6};
y(q,h)=SortDate{q+numPT*(h-1),7};
c(q,h)=SortDate{q+numPT*(h-1),5};
end
end

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

pg
2017년 7월 21일

댓글:

pg
2017년 8월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by