Documentation of expandm

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

Function Synopsis

MatOut = expandm(MatIn, EXPN)

Help text

 EXPAND a Matrix, utility function

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

 Input parameters:
    MatIn     - Input Matrix (before expanding)
    EXPN      - Vector of 2 numbers, how often expand in each
                   dimensiom
                EXPN(1): replicate vertically
                EXPN(2): replicate horizontally

 Output parameter:
    MatOut    - Output Matrix (after expanding)

 Example:
    MatIn = [1 2 3
             4 5 6]

    EXPN = [1 2] => MatOut = [1 1 2 2 3 3;
                              4 4 5 5 6 6]

    EXPN = [2 1] => MatOut = [1 2 3;
                              1 2 3;
                              4 5 6;
                              4 5 6]

    EXPN = [3 2] => MatOut = [1 1 2 2 3 3;
                              1 1 2 2 3 3;
                              1 1 2 2 3 3;
                              4 4 5 5 6 6;
                              4 4 5 5 6 6;
                              4 4 5 5 6 6]

 See also: repmat

Cross-Reference Information

This function is called by
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).