{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

scan0005 - a ”gets Windows E0000000e 000mg:5 E 000000 E 0...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a ”gets Windows E0000000e+000mg :5 E 000000 E 0 1,)«wmawmmwsmw. Eflmmwwwmmw 3.”.M..WMMWWWEM_W_VM “a...“ , Others E'-0.000000e+00 E 0.000000 E—o x A Numeric or character array. Examples Print multiple values and literal text to the screen: B e [8.8 7.7 ; .. 8800 7700]; fprintf('X is %4.2f meters or %8.3f mm\n', 9.9, 9900, B) MATLAB displays: X is 9.90 meters or 9900.000 mm X is 8.80 meters or 8800.000 mm X is 7.70 meters or 7700.000 mm Explicitly convert double-precision values with fractions to integer values, and print to the screen: a = [1.02 3.04 5.06]; fprintf('%d\n', roundia)); Write a short table of the exponential function to a text file called exp . txt: x = O:.l:l; = ix; EXIMXH; '< % open the file with write permission fid = fopeni'exp.txt’, 'w‘); fprintflfid, '%6.2f %12.8f\n', y); fclose(fid); % View the contents of the file type exp.txt MATLAB import functions, all UNIX applications, and Microsoft Word and WordPad recognize ' \n' as a newline indicator. However, if'you plan to read the file with Microsoft Notepad, use ‘ \r\n' to move to a new line when writing. For example, replace the previous call to fprintf with the following: fprintf(fid, '%6.2f %12.8f\r\n‘, Y); ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online