Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Group: Matrix Manipulation
Topic: General Commands
See also: paf sort

Function: index
Description: index generates a new matrix z from an old matrix x by resampling the rows of x depending on the index vector i.

Usage: y = index (x, ind)
Input:
x n x p matrix
ind k dimensional vector
Output:
y k x p matrix

Note:

Example:
x = #(0.1, 0.2, 0.3, 0.4)
i = #(4, 3, 2, 2, 1)
( index(x, i) )'

Result:
Contents of _tmp



[1,]   0.4   0.3   0.2   0.2   0.1



(C) MD*TECH Method and Data Technologies, 05.02.2006