How to arrange answers for iterations

1 回表示 (過去 30 日間)
Arjun
Arjun 2014 年 5 月 31 日
コメント済み: Arjun 2014 年 6 月 1 日
I have the following iteration running.
a=20000:5000:90000
for ct1=1:1:length(a)
b=300:20:460
for ct2=1:1:length(b)
c=150:10:300
for ct3=1:1:length(c)
d=0.5:0.1:0.8
for ct4=1:1:length(d)
e=2000:100:2300
for ct5=1:1:length(e)
x(ct1,ct2,ct3,ct4,ct5)=a(ct1)+ b(ct2)- (c(ct3))^2 + d(ct4)+ e(ct5)
end
end
end
end
end
how can I program it such that I will have all the value arranged accordingly each time the iteration runs. Example
a=20000, b=300, c=150, d=0.5, e=2000, x=-199.5
then it updates for each other iterations. tq

採用された回答

the cyclist
the cyclist 2014 年 5 月 31 日
Put this line in your code, just after you assign the value to x:
sprintf('a=%d, b=%d, c=%d, d=%f, e=%d, f=%f',a(ct1),b(ct2),c(ct3),d(ct4),e(ct5),x(ct1,ct2,ct3,ct4,ct5))
  1 件のコメント
Arjun
Arjun 2014 年 6 月 1 日
thx =)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by