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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by