| The general formatting syntax for these functions is functionname(..., format_string, value1, value2, valueN) where the format_string argument expresses the basic content and formatting of the final output string, and the value arguments that follow supply data values to be inserted into the string. Here is a sample sprintf statement, also showing the resulting output string: sprintf('The price of %s on %d/%d/%d was $%.2f.', ... 'bread', 7, 1, 2006, 2.49) ans = The price of bread on 7/1/2006 was $2.49. The following sections cover • "The Format String" on page 2-47 • "Input Value Arguments" on page 2-48 • "The Formatting Operator" on page 2-50 • "Constructing the Formatting Operator" on page 2-50 • "Setting Field Width and Precision" on page 2-55 • "Restrictions for Using Identifiers" on page 2-58 |