%% Literal Text and Array Inputs
% Combine literal text with array values to create a character vector.

formatSpec = 'The array is %dx%d.';
A1 = 2;
A2 = 3;
str = sprintf(formatSpec,A1,A2)

% Copyright 2012 The MathWorks, Inc.