Function s = textblockcat(c)
s = textblockcat(c,opt)
concatenates the lines in the given strings into one
single string.
The input argument c is a cell-array of character row
vectors. The output argument will consist of a single
character row vector.
The concatenation is done "line-wise per cell-array row",
i.e. per respective line on the same row in cell-array c.
If a line il, found in the string of element c{ir,ic}, is
indicated by "c{ir,ic}{il}", and the number of columns in
c is indicated by nc, the resulting column cell-array for
row ir may be expressed as:
{
[ c{ir,1}{1} c{ir,2}{1} ... c{ir,nc}{1} ];
[ c{ir,1}{2} c{ir,2}{2} ... c{ir,nc}{2} ];
[ c{ir,1}{3} c{ir,2}{3} ... c{ir,nc}{3} ];
...
}
Empty lines will be appended, if an element contains less
lines than the other elements on the same row of
cell-array c.
If input argument c is a character row vector, it is
returned as-is.
The optional input arugment opt is a struct or a row
cell-array of key-value pairs. Below, settings are
indicated by opt as a struct, and the default value of
each field are given too:
opt.linedelim = "\n";
opt.linedelim contains the line delimiter, i.e. the
character by which lines are separated within a
string.
The function internally calls the following non-standard
m-files:
-- kvpairs2struct.m
(c) 2026 fabien van mook
2026.08.20 release of this file within package "fvm-textblock" under GNU GPLv3+