Documentation of rep

Global Index (all files) (short | long) | Local contents | Local Index (files in subdir) (short | long)

Function Synopsis

MatOut = rep(MatIn, REPN)

Help text

 REPlicate a matrix, utility function

 This function repeats a matrix MatIn in both dimensions.
 In the output matrix MatOut the input matrix MatIn is
 repeated as often as defined in REPN. The size of MatOut is
 [REPN(1)*size(MatIn,1), REPN(2)*size(MatIn,2)].
 This function is widely used in the GEA Toolbox.

 Syntax:  MatOut = rep(MatIn, REPN);

 Input parameters:
    MatIn     - Input Matrix (befor replicating)
    REPN      - Vector of 2 numbers, how often replicate in each
                   dimensiom
                REPN(1): replicate vertically
                REPN(2): replicate horizontally

 Output parameter:
    MatOut    - Output Matrix (after replicating)

 Example:
    MatIn = [1 2 3;
             4 5 6]
    REPN = [1 2] => MatOut = [1 2 3 1 2 3;
                              4 5 6 4 5 6]
    REPN = [2 1] => MatOut = [1 2 3;
                              4 5 6;
                              1 2 3;
                              4 5 6]
    REPN = [3 2] => MatOut = [1 2 3 1 2 3;
                              4 5 6 4 5 6;
                              1 2 3 1 2 3;
                              4 5 6 4 5 6;
                              1 2 3 1 2 3;
                              4 5 6 4 5 6]

 See also: expandm
GEATbx: Main page  Tutorial  Algorithms  M-functions  Parameter/Options  Example functions  www.geatbx.com 

This document is part of version 3.8 of the GEATbx: Genetic and Evolutionary Algorithm Toolbox for use with Matlab - www.geatbx.com.
The Genetic and Evolutionary Algorithm Toolbox is not public domain.
© 1994-2006 Hartmut Pohlheim, All Rights Reserved, (support@geatbx.com).