MATLAB: How to Change only certain Values in a matrix with a different vector

MATLABvector

So I have a 1×3 vector A and i have matrix B which is 100×3. How do I get the the rows 1:20 to be vector A?
ex:
A = [10 -10 0];
B = zeros(100,3);
B(1:20,:) = A
and then I get the error "Unable to perform assignment because the size of the left side is 100-by-3 and the size of the right side is 1-by-3."
How do I fix this error? I would also rather not use a for loop in this instance.

Best Answer

B(1:20,:) = repmat(A,[20 1])
or
B(1:20,:) = repmat(A,20,1)
or
B(1:20,:) = repelem(A,20,1)