next up previous
Next: MATLAB variables Up: MATLAB summary Previous: Introduction

Some general purpose commands


[Ctrl] c i.e. hold down the control key and then press c: interrupt a MATLAB process

clear: clear all variables and functions from memory

clear a b c: clear variables a,b and c

format long/short: gives 15/5 digit output e.g.

>> format short
>> pi
ans =
    3.1416
>> format long
>> pi
ans =
   3.14159265358979
>>

who or whos: checks on currently defined variables e.g.

>> a=[1 2 3; 4 5 6]
a =
     1     2     3
     4     5     6
>> whos a

  Name      Size         Bytes  Class
  a         2x3             48  double array

Grand total is 6 elements using 48 bytes
which means that the variable a is a double-precision array (each element has roughly sixteen significant figures) with two rows and three columns.


Charlie Macaskill
Fri Mar 5 16:05:28 EST 1999

Copyright © University of Sydney 2003