MATLAB: Fill row of matrix

fill matrixMATLAB

Assume I have d=[1 3 5 6 7 8 1 4 5 10], and e=zeros(5,10). I want to take only the first 4 elements of d and put them into the first row of e.

Best Answer

d=[1 3 5 6 7 8 1 4 5 10],
e=zeros(5,10)
e(1,1:4)=d(1:4)