I'm trying to create a for loop that will print:
A=1 3 5
6 8 10
11 13 15

1 件のコメント

Adam
Adam 2019 年 9 月 4 日
編集済み: Adam 2019 年 9 月 4 日
Why do you need a for loop and where do you want to print it to? If A is definied in the workspace then just
A
will print it to command line.

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

回答 (1 件)

Star Strider
Star Strider 2019 年 9 月 4 日

0 投票

Try this:
for k = 1:3
V = (1+5*(k-1)):2:5*k
end
Experiment to get the result you want.

カテゴリ

ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索

製品

リリース

R2018a

タグ

質問済み:

2019 年 9 月 4 日

回答済み:

2019 年 9 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by