23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Data Types<br />

An alternate syntax, that enables you to supply values for the field width and<br />

precision fields from values in the argument list, is shown below. See the<br />

section “Specifying Field Width and Precision Outside the format String” on<br />

page 2-53 for information on when and how to use this syntax. (Again, space<br />

characters are shown only to improve readability of the figure.)<br />

Each field of the formatting operator is described in the following sections.<br />

These fields are covered as they appear going from right to left in the<br />

formatting operator, starting with the Conversion Character and ending<br />

with the Identifier field.<br />

Conversion Character. The conversion character specifies the notation of<br />

the output. It consists of a single character and appears last in the format<br />

specifier. It is the only required field of the format specifier other than the<br />

leading % character.<br />

Specifier<br />

c<br />

d<br />

e<br />

E<br />

f<br />

g<br />

G<br />

o<br />

s<br />

u<br />

Description<br />

Single character<br />

Decimal notation (signed)<br />

Exponential notation (using a lowercase e as in 3.1415e+00)<br />

Exponential notation (using an uppercase E as in 3.1415E+00)<br />

Fixed-point notation<br />

Themorecompactof%e or %f. (Insignificant zeros do not<br />

print.)<br />

Same as %g, but using an uppercase E<br />

Octal notation (unsigned)<br />

String of characters<br />

Decimal notation (unsigned)<br />

2-48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!