how to multiply integers

9 ビュー (過去 30 日間)
Taylor Mattison
Taylor Mattison 2018 年 11 月 6 日
コメント済み: madhan ravi 2018 年 11 月 6 日
This is the question I got asked.
when I enter for i=1:10
k=i*222
end
  1 件のコメント
Stephen23
Stephen23 2018 年 11 月 6 日
By the way, the best method is without a loop:
V = 10 * (1:15);
fprintf('%.2f\n',V)

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

回答 (1 件)

madhan ravi
madhan ravi 2018 年 11 月 6 日
編集済み: madhan ravi 2018 年 11 月 6 日
for i=1:10
k=i*222;
fprintf('value is %.2f\n',k) %or
sprintf('value is %.2f',k)
end
  1 件のコメント
madhan ravi
madhan ravi 2018 年 11 月 6 日
@Taylor don't change your question after someone gives answer it makes the answer look stupid!

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by