
% clear the variables in the matlab workspace
clear

% show commands
echo;

disp('press a key to continue');
pause; % wait for a key hit

% how to set a variable
t = 1.1

% how to set a matrix
A = [1 2; 3 4]

% evlauating expressions
B = t*A

% how to access matrix column
c = A(:,1)

% how to access a matrix row
r = A(2,:)

disp('press a key to continue');
pause; % wait for a key hit

% how to initialize a matrix with zeros
r = zeros(3,10)

% normally an array of vectors is represented
% as a matrix as follows with each vector a column

r(:,1) = [1 2 3] % setting the first vector
r(:,10) = [7 7 7] % setting the last vector

disp('press a key to continue');
pause; % wait for a key hit

% how to call your own user made function
[a,m] = function_example1(r)

disp('press a key to continue');
pause; % wait for a key hit

% example of how to get help on a command
help plot

disp('press a key to continue');
pause; % wait for a key hit

% how to get demonstration of libraries
demo

% turn echo off
echo;

