Products & Services Solutions Academia Support User Community Company


ind2vec

Purpose

Convert indices to vectors

Syntax

Description

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

ind2vec(ind) takes one argument,

ind
Row vector of indices

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


 Provide feedback about this page 

Previous page hintonwb init Next page

Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS