Convert vector of indices into matrix
I want to convert a vector of indices into a matrix with ones in the columns of the indices.

    x = [2;1;3;1];
    m = someFunc(x,3)
    % m =
    %
    %   0   1   0
    %   1   0   0
    %   0   0   1
    %   1   0   0



Convert vector of indices into matrix
===

I want to convert a vector of indices into a matrix with ones in the columns of the indices.

    x = [2;1;3;1];
    m = someFunc(x,3)
    % m =
    %
    %   0   1   0
    %   1   0   0
    %   0   0   1
    %   1   0   0


