Navigation

Operators and Keywords

Function List:

C++ API

: list_in_columns (arg, width, prefix)

Return a string containing the elements of arg listed in columns with an overall maximum width of width and optional prefix prefix.

The argument arg must be a cell array of character strings or a character array.

If width is not specified or is an empty matrix, or less than or equal to zero, the width of the terminal screen is used. Newline characters are used to break the lines in the output string. For example:

list_in_columns ({"abc", "def", "ghijkl", "mnop", "qrs", "tuv"}, 20)
    ⇒ abc     mnop
       def     qrs
       ghijkl  tuv

whos ans
    ⇒
    Variables in the current scope:

      Attr Name        Size                     Bytes  Class
      ==== ====        ====                     =====  =====
           ans         1x37                        37  char

    Total is 37 elements using 37 bytes

See also: terminal_size.

Package: octave