"Can anybody please explain me why the 'break' command doesn't work in the following code?"
Explanation: The reason is because of the orientation of h.
You define H with size 1x4 (i.e. a row vector) and from that you ctranspose it so that h has size 4x1.
The for documentation explains that for iterates over the columns of the values array (not over the elements as you probably expected), so you defined a loop which iterates just once and for which i will be that column vector. You can confirm the size of i simply by printing it after the loop. So i also has size 4x1, and therefore G also has size 4x1:
The if documentation states that its condition "... expression is true when its result is nonempty and contains only nonzero elements (logical or real numeric). Otherwise, the expression is false." Your condition G<0 is certainly non-empty, but are all of its elements non-zero? Lets have a look:
No, first three elements are false/zero. Therefore your condition expression is false, and so the code inside the if is not run.
Solution: you will get the expected behavior by supplying for with a row vector, not a column vector, e.g.:
H = 1:4;
for k = H
G = 3-k;
if G < 0
disp('break!')
break
end
end