The compose function can return multiple pieces of formatted text as a string array or a cell array of character vectors, unlike sprintf . The sprintf function returns only a string scalar or a character vector.