28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

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.

fprintf<br />

Examples The statements<br />

2-884<br />

Note fprintf displays negative zero (-0) differently on some platforms, as<br />

shown in the following table.<br />

x = 0:.1:1;<br />

y = [x; exp(x)];<br />

fid = fopen('exp.txt','w');<br />

fprintf(fid,'%6.2f %12.8f\n',y);<br />

fclose(fid)<br />

create a text file called exp.txt containing a short table of the exponential<br />

function:<br />

0.00 1.00000000<br />

0.10 1.10517092<br />

...<br />

1.00 2.71828183<br />

The command<br />

fprintf('A unit circle has circumference %g radians.\n',2∗pi)<br />

displays a line on the screen:<br />

A unit circle has circumference 6.283186 radians.<br />

To insert a single quotation mark in a string, use two single quotation marks<br />

together. For example,<br />

fprintf(1,'It''s Friday.\n')<br />

displays on the screen<br />

Conversion Character<br />

Platform %e or %E %f %g or %G<br />

PC 0.000000e+000 0.000000 0<br />

Others -0.000000e+00 -0.000000 -0

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

Saved successfully!

Ooh no, something went wrong!