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 ExchangeLoops 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