sweet
clc
a = 0;
z = 1;
n = 10
for b = 1:n;
if z <= n/2;
a = a+1
z = z+1;
elseif z == n;
z = 0;
else
a = a-1;
z = z+1;
end
end
nice!
1421 Solvers
Project Euler: Problem 5, Smallest multiple
397 Solvers
289 Solvers
Arrange vector in ascending order
624 Solvers
Count decimal digits of a number
176 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!