a = zeros(100,1); for counter = 1:sqrt(100); a(counter^2) = 1; end a