Contents Previous Next Subchapters

Packs An Entire Character Matrix Into One Row Vector
Syntax pack(match)
See Also clipstr , unpack , file2str

Returns a character row vector that contains the information in the entire character matrix mat where mat has at least one row. Leading and trailing spaces in each row of mat are not included in the return value. The character ch, followed by a space, is placed between the rows of mat in the return value. To be specific, if row1, row2, ... , and rowN are the rows of mat with leading and trailing spaces removed, the return value is the row vector
     [row1, ch, " ", row2, ch, " ", ... , rowN]
The function pack is useful when multiple character matrices need to be packed into one large character matrix. If the character ch is not present in the matrix mat, the original information can be recovered using the function unpack .

If you enter
     mat = {"row 1", "row 2", "row 3"}
     ch  = ","
     pack(mat, ch)
O-Matrix will respond
     row 1, row 2, row 3