Here are some commands we should become familiar with:

 

up arrow – scroll up to previous commands

down arrow – scroll forwards through previous commands

backspace and side arrow keys - for editing previous commands

Tab key – for file completion

 

clc – clears the command window

clear – clears the workspace of all variables

close all – closes all figure windows

 

exist(‘name’) – find out if a file or variable exists (you get a 1 if it does, 0 if not)

lookfor name – shows you what matlab commands make mention of the name you type in

help name – gives you help on matlab’s command name (if it exists)

help – top level help

whos – workspace variables and their sizes

who – workspace variable names only

 

ls, dir – lists the files in the current matlab directory

cd – used to change to different directories (cd ../  etc).

pwd – shows you your current matlab directory path

 

save name  – save all the variables (matrices/arrays) into a file in your current director called name.mat

save name a,b,c – saves the variables a,b,c to a file name.mat

load name – loads all the variables stored in name.mat into current workspace

diary name – all subsequent commands are recorded in a file called name

diary on – turns diary back on after a diary off comand

diary off – stops recording commands into the diary file

print – prints the current figure (the one displayed in front of any others).

 

quit – exits you from matlab