write script( a for loop that multiplies all evens numbers from 2 to 10)
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Please help
0 Kommentare
Antworten (2)
Andriy Kavetsky
am 24 Okt. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!