write script( a for loop that multiplies all evens numbers from 2 to 10)
5 views (last 30 days)
Show older comments
Please help
0 Comments
Answers (2)
Andriy Kavetsky
on 24 Oct 2016
x=2:10;
x=x(mod(x,2)==0)
res=1;
s=size(x)
for i=1:s(1) for j=1:s(2)
res=res*x(i,j);
end
end
0 Comments
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!