A for loop that multiplies all even numbers from 2 to 10.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2015년 11월 23일

0 개 추천

prod(2:2:10);

댓글 수: 2

daniel clarke
daniel clarke 2015년 11월 23일
How would you put that into the for loop?
Torsten
Torsten 2015년 11월 23일
편집: Torsten 2015년 11월 23일
out = 1;
for jj = 2:2:10
out = out*jj;
end

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2015년 11월 23일

편집:

2015년 11월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by