How to write it in a loop?
古いコメントを表示
a = 2
b = 3
p1(1) = a.b
p1(2) = a.b^2
p2(1) = a^2.b
p2(2) = a^2.b^2
.......i.e pi(j) = 2^i * 3^j where i from 1 to 4 and j from 1 to 5
Could someone please tell how to write this in a 'for' loop?
回答 (1 件)
Walter Roberson
2019 年 3 月 20 日
Hint:
Q17(1) = 18.5 - 82/19;
for K = 2 : 157
Q17(K) = Q17(K-1) + 82/19;
end
is equivalent to Q17(K) = 18.5 + 82/19*K
2 件のコメント
parag gupta
2019 年 3 月 20 日
編集済み: parag gupta
2019 年 3 月 20 日
Walter Roberson
2019 年 3 月 21 日
Looks plausible.
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!