When evaluated on a vector, conditional statements return true only if all elements of the vector match the condition. So
x = [-12: .5: 12];
if x >= -12 & x < -3
% do something
end
is the same as
x = [-12: .5: 12];
if all(x >= -12 & x < -3)
% do something
end
And in your case, that statement evaluates as false, so nothing happens.
Logical indexing is the better way to achieve what you want:
x = [-12: .5: 12];
plot(x(x > -12 & x <-3));
or if you want to stick with a for loop and plot each point as a different object (not really recommended, but just for reference), you'll need to index:
hold on;
x = [12:0.5:12];
for ii = 1:length(x)
if x(ii) > -12 && x(ii) < -3
plot(x(ii));
end
end