User`s guide

Programming
20-27
extra task of sorting through the output and merging like data types together in your
own code.
For more information, see the textscan function reference page.
Numbered Arguments for Formatted String Functions
Using numbered argument specification with MATLAB functions that employ format
specifiers such as %d or %s (e.g., sprintf, error), you can pass the numeric and character
string values that correspond to these format specifiers in a varying order. This can be
useful when translating format strings in a different sentence structure.
In addition to identifying the values, you can also use numbered arguments to specify
the field width and precision of the format specifiers. In the following example, the first
format specifier in the sprintf command is %1$*4$f (quite different from the usual %f
specifier). The 1$ tells MATLAB that the value that is to replace this format specifier is
in the first argument following the format string; that is, 123.45678. The *4$ indicates
that the field width for this specifier is being passed in the fourth argument following the
format string: 15.
In the second and third arguments (%2$.*5$f and %3$*6$.*7$f), the symbols 2$ and
3$ represent the values, *5$ and *7$ represent precisions, and *6$ represents field
width:
sprintf('%1$*4$f %2$.*5$f %3$*6$.*7$f', ...
123.45678, 16.42837, pi, 15, 3, 6, 4)
ans =
123.456780 16.428 3.1416
For more information, see Formatting Strings in the MATLAB Programming
documentation.
The dir Function Returns Additional datenum Field
The dir function now returns the date the file or directory was last modified in two
formats: string and numeric. The numeric date value is not specific to any particular
locale, and thus is compatible for international use:
fileinfo = dir('myfile.txt')