Please help with this

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

Answers (1)

prod(2:2:10);

2 Comments

How would you put that into the for loop?
Torsten
Torsten on 23 Nov 2015
Edited: Torsten on 23 Nov 2015
out = 1;
for jj = 2:2:10
out = out*jj;
end

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Asked:

on 23 Nov 2015

Edited:

on 23 Nov 2015

Community Treasure Hunt

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

Start Hunting!