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!
Return the 3n+1 sequence for n
6293 Solvers
Find the alphabetic word product
2353 Solvers
Project Euler: Problem 10, Sum of Primes
735 Solvers
309 Solvers
middleAsColumn: Return all but first and last element as a column vector
399 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!