23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2disp<br />

Purpose Display text or array<br />

Syntax disp(X)<br />

Description disp(X) displays an array, without printing the array name. If X contains a<br />

text string, the string is displayed.<br />

Another way to display an array on the screen is to type its name, but this<br />

prints a leading “X =,” which is not always desirable.<br />

Note that disp does not display empty arrays.<br />

Examples One use of disp in an M-file is to display a matrix with column labels:<br />

disp(' Corn Oats Hay')<br />

disp(rand(5,3))<br />

which results in<br />

Corn Oats Hay<br />

0.2113 0.8474 0.2749<br />

0.0820 0.4524 0.8807<br />

0.7599 0.8075 0.6538<br />

0.0087 0.4832 0.4899<br />

0.8096 0.6135 0.7741<br />

See Also format, int2str, num2str, rats, sprintf<br />

disp<br />

2-447

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

Saved successfully!

Ooh no, something went wrong!