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!
Replace NaNs with the number that appears to its left in the row.
2018 Solvers
Determine if a Given Number is a Triangle Number
322 Solvers
17120 Solvers
Set some matrix elements to zero
290 Solvers
Add a row of zeros on top of a matrix
193 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!