can i write simple for loop in the command window

Have some output data and I need to organize it. simple for loop will do but can i write it in the command window?

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 8 月 1 日
編集済み: Azzi Abdelmalek 2013 年 8 月 1 日

1 投票

for k=1:3;a(k)=k^2;end
%or
for k=1:3,...
a(k)=k^2,...
end

1 件のコメント

Andrew Kreitzman
Andrew Kreitzman 2013 年 8 月 1 日
ohhhh i wasn't adding the colon after the for. thanks!

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

カテゴリ

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

質問済み:

2013 年 8 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by