COL2MAT is the jVarfun module of jLab.

 COL2MAT  Expands 'column-appended' data into a matrix.
    M=COL2MAT(C), where C is a column vector of data segments separated by
    NANs, returns a matrix M in which each segment has its own column.  
    M will have enough rows to fit the longest data segment. Segments are
    read into columns of M from the top down, leaving empty spaces at the 
    bottom which are filled in with NANs.
    If the data is complex, then gaps are filled with NAN+SQRT(-1)*NAN;
    [M1,M2,...,MN]=COL2MAT(C1,C2,...,CN), where the CN are input column
    vectors, also works, as does [M1,M2,...,MN]=COL2MAT(MAT), where MAT is 
    a matrix of column vectors.  In both cases the locations of NaNs in the 
    first column is used as the reference for the others. 
    COL2MAT(C1,C2,...); with no output arguments overwrites the original 
    input variables.
    COL2MAT, MAT2COL, and COLBREAKS together form a system for moving data
    with segments of nonuniform length rapidly back and forth between a 
    column format and a padded-matrix format. 
    Note that while COL2CELL and CELL2COL work for arrays having multiple
    columns, COL2MAT only works with column vectors. 
    This is part of JLAB --- type 'help jlab' for more information 
    (C) 2000--2016 J.M. Lilly --- type 'help jlab_license' for details

contents | allhelp | index