i have a vector a = [1; 6; 8]
and want to create a matrix with n
columns and size(a,1)
rows.
Each i'th row is all zeros but on the a(i)
index is one.
>> make_the_matrix(a, 10)
ans =
1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0