next up previous contents
Next: GETLINE Get a Line Up: Input/Ouput Functions Previous: LOAD Load Variables From   Contents

Subsections

DISP Display a Variable or Expression

Usage

Displays the result of a set of expressions. The disp function takes a variable number of arguments, each of which is an expression to output:

  disp(expr1,expr2,...,exprn)

This is functionally equivalent to evaluating each of the expressions without a semicolon after each.

Example

Here are some simple examples of using disp.

--> a = 32;
--> b = 1:4;
--> disp(a,b,pi)
  <int32>  - size: [1 1]
            32  
  <int32>  - size: [1 4]
 
Columns 1 to 4
             1              2              3              4  
  <double>  - size: [1 1]
    3.141592653589793



Samit K. Basu 2005-03-16