MatrixBerryCore
Namespaces | Functions
mxberry::core::cell Namespace Reference

Namespaces

 test
 

Functions

function cell2mat (in inpCArr)
 CELL2MAT does the same as the built-in cell2mat function but a) 20% faster b) works with cell arrays of objects and even values of different types, the only limitation is ability of the built-in cat function to concatenate values from inpCArr to process them. More...
 
function cell2tablestr (in titleList, in dataCell, in colSepSeq, in varargin)
 CELL2TABLESTR - converts a cell array into a table-like char array (or a cell array of strings representing table rows). More...
 
function cellformatter (in inpCont)
 
function cellstr2colstr (in inpCArr, in indentStr)
 CELLSTR2COLSTR transforms a cell array of strings into a row string that looks like a column when displayed. More...
 
function cellstr2expression (in inpCMat, in isMatrixStyle, in isQuotingSkipped)
 CELLSTR2EXPRESSION creates Matlab expression based on cell matrix of expressions corresponding to the individual elements of the matrix. More...
 
function cellstr2func (in inpCMat, in inpArgNameList)
 CELLSTR2EXPRESSION creates Matlab expression based on cell matrix of expressions corresponding to the individual elements of the matrix. More...
 
function csvwrite (in fileName, in inpCMat, in varargin)
 CSVWRITE writes a specified cell matrix into a comma-separated file specified by name. All columns of the matrix are expected to be of the same type. As of the moment only 'char' and all numeric types are supported. More...
 
function checkTypeOfAllRows (in isNeededTypeMat, in typeName)
 
function showcell (in inpCArr, in varargin)
 SHOWCELL generates a string representation of cell array or displays it in a console. More...
 
function showCellInternal (in inpCMat, in nSpaces, in fNumPrint, in fCharPrint, in fCellPrint, in isAsExpression, in nMaxShownArrayElems)
 
function other2str (in inpVal)
 
function numArr2str (in inpVal, in ignoredArg, in isClassShown, in varargin)
 
function charArr2str (in inpVal, in isAsExpression)
 
function getEmptyStr (in x)
 

Function Documentation

◆ cell2mat()

function mxberry::core::cell::cell2mat ( in  inpCArr)

CELL2MAT does the same as the built-in cell2mat function but a) 20% faster b) works with cell arrays of objects and even values of different types, the only limitation is ability of the built-in cat function to concatenate values from inpCArr to process them.

*  Input:
*    regular:
*        inpCArr: cell[] - input cell arrat of arbitrary type
*  Output:
*    outArr: any[] - exactly the same array the built-in `cell2mat` function
*        would provide
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ cell2tablestr()

function mxberry::core::cell::cell2tablestr ( in  titleList,
in  dataCell,
in  colSepSeq,
in  varargin 
)

CELL2TABLESTR - converts a cell array into a table-like char array (or a cell array of strings representing table rows).

*  Usage: tableStr=cell2tablestr(titles,dataCell,sepSymbol,varargin)
* 
*  Input:
*    regular:
*        titleList: cell[1,nCols]- cell array of column titles
*        dataCell: cell[nRows,nCols] - data cell array
*        colSepSeq: char[1,] - a string used for separating neighboring
*           columns
* 
*    properties:
*        isMatlabSyntax: logical[1,1] - forms result according to Matlab
*           syntax(default=0);
*        UniformOutput: logical[1,1] - if true, output is char array, if
*           false - output is cell array; by default true;
*        minSepCount: double[1] - minimal number of separation used for
*            separating neighboring columns
*        numPrecision: double[1,1] - number of digits used for displaying
*           numeric values
* 
*  Output:
*    tableStr: char[nRows,nCols] or cell[nLines,1] of char[1,] - output character
*        array or cell array of lines
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ cellformatter()

function mxberry::core::cell::cellformatter ( in  inpCont)

◆ cellstr2colstr()

function mxberry::core::cell::cellstr2colstr ( in  inpCArr,
in  indentStr 
)

CELLSTR2COLSTR transforms a cell array of strings into a row string that looks like a column when displayed.

*  Input:
*    regular:
*        inpCArr: cell[] of char[1,] - input array of strings
*    optional:
*        indentStr: char[1,] - an indent applied to each of the strings in
*           the input array
*            Default: '' i.e. no indent
* 
*  Output:
*    resStr: char[1,] - resulting string
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ cellstr2expression()

function mxberry::core::cell::cellstr2expression ( in  inpCMat,
in  isMatrixStyle,
in  isQuotingSkipped 
)

CELLSTR2EXPRESSION creates Matlab expression based on cell matrix of expressions corresponding to the individual elements of the matrix.

*  Input:
*    regular:
*        inpCMat: cell[nRows,nCols] of char[1,] - input matrix of
*            expression
*        isMatrixStyle: logical[1,1] - if false (default) the
*            curcly (cell style braces are used) and each cell is surrounded
*            by quotes (unless isQuotingSkipped=true). If true square braces
*            (matrix style) are used and no quotes are used.
* 
*    optional:
*        isQuotingSkipped: logical[1,1] - if true, no quotes are used even
*        for isMatrixStyle=false
* 
*  Output:
*    resStr: char[1,] - resulting expression for the matrix
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ cellstr2func()

function mxberry::core::cell::cellstr2func ( in  inpCMat,
in  inpArgNameList 
)

CELLSTR2EXPRESSION creates Matlab expression based on cell matrix of expressions corresponding to the individual elements of the matrix.

*  Input:
*    regular:
*        inpCMat: cell[nRows,nCols] of char[1,] - input matrix of
*            expressiosn
*        inpArgNameList: cell[1,nArgs] of char[1,]/char[1,] - names of input
*            arguments for the resulting function
*  Output:
*    fHandle: function_handle[1,1] - resulting expression for the matrix
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ charArr2str()

function mxberry::core::cell::charArr2str ( in  inpVal,
in  isAsExpression 
)

◆ checkTypeOfAllRows()

function mxberry::core::cell::checkTypeOfAllRows ( in  isNeededTypeMat,
in  typeName 
)

◆ csvwrite()

function mxberry::core::cell::csvwrite ( in  fileName,
in  inpCMat,
in  varargin 
)

CSVWRITE writes a specified cell matrix into a comma-separated file specified by name. All columns of the matrix are expected to be of the same type. As of the moment only 'char' and all numeric types are supported.

*  Input:
*    regular:
*        fileName: char[1,] - name of the destination file
*        dataCMat: cell[nRows,nCols] - cell array containing numberic and
*           character data
* 
*    properties:
*        delimiter: char[1,] - delimiter used for separating columns
*            Default: ','
*        columnNameList: cell[1,] of char[1,] - list of column names
*        numFormat: char[1,] - numbers display format string for
*            built-in sprintf function
*            Default: %10.10g
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ getEmptyStr()

function mxberry::core::cell::getEmptyStr ( in  x)

◆ numArr2str()

function mxberry::core::cell::numArr2str ( in  inpVal,
in  ignoredArg,
in  isClassShown,
in  varargin 
)

◆ other2str()

function mxberry::core::cell::other2str ( in  inpVal)

◆ showcell()

function mxberry::core::cell::showcell ( in  inpCArr,
in  varargin 
)

SHOWCELL generates a string representation of cell array or displays it in a console.

*    Input:
*        regular:
*            inpCArr: cell[] - cell array of arbitrary dimension
*        properties:
*            nSpaces: numeric[1,1]  - column spacing.
*                Default is 4.
*            nDigits: numeric[1,1] - maximum number of significant digits
*                in the output string,specified as a positive integer.
*                Default is 5.
*            printVarName: logical[1,1] - if true (default),variable name is
*                printed when no output arguments is requested
*            varName: char[1,] - variable name to print,by default it is
*                determined automatically
*            showClass: logical[1,1] - if true, a class of numeric values is
*                displayed in the format used by the built-in 'mat2str'
*                function
*            asExpression: logical[1,1] - if true, the output string is
*                displayed as Matlab expression.
*            nMaxShownArrayElems: double[1,1] - maximum number of scalar
*                array elements show "as is"; if an array has more elements or
*                more than 1 dimension its content is not shown, only type
*                and size information
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ showCellInternal()

function mxberry::core::cell::showCellInternal ( in  inpCMat,
in  nSpaces,
in  fNumPrint,
in  fCharPrint,
in  fCellPrint,
in  isAsExpression,
in  nMaxShownArrayElems 
)