Neural Network Toolbox Previous page   Next Page
ind2vec

Convert indices to vectors

Syntax

vec = ind2vec(ind)

Description

ind2vec and vec2ind allow indices to either be represented by themselves, or as vectors containing a 1 in the row of the index they represent.

ind2vec(ind) takes one argument,

and returns a sparse matrix of vectors, with one 1 in each column, as indicated by ind.

Examples

Here four indices are defined and converted to vector representation.

See Also

vec2ind


Previous page  hintonwb init Next page

© 1994-2005 The MathWorks, Inc.