% SECTION 1:  commands for file system
% dir , ls,  pwd
% mkdir, cd, rmdir

clear
format short

dir *.m
ls  *.m
pwd
mkdir cs101_example
ls cs*
cd cs101_example
pwd
cd ..
rmdir cs101_example
pwd

ls *.m

% SECTION 2 : variables and constants
10
whos
ans
a=11
whos
ans
a
z=input('press any key');
clc
disp(a)
disp(ans)
whos
clear
whos
% this is a comment
z=input('press any key');
a=10;
b=11;

% SECTION 3 : Arithmetic operations
whos
3+4;
3+ ...
4
3*5
4/5
4\5
4^3
exp(1.0)
log(1.0)
sin(30)
sin(pi/6)
sind(30)
sin(pi)
cos(pi)
sin(pi/2)
cos(pi/2)

% SECTION 4: format long and format short  and format hex
z=input('press any key');
clear
a=10;b=11.0;c=5/3;d=10.00;e=1.2e-5;f=1.2e3;
disp('format long');
format long
a
b
disp('format short');
format short
a
b
z=input('press any key');
disp('format long');
format long
c
d
disp('format short');
format short
c
d
z=input('press any key');
disp('format long');
format long
e
f
disp('format short');
format short
e
f
disp('special names');
format short
clear;
i
j
i*i
j*j

disp('format long');
format long
pi
disp('format short');
format short
pi

disp('format hex   (pi in hexadecimal)');
format hex
pi
format short

% SECTION 5: Inf for Infinity   NaN Not a Number (Inf/Inf)

clear
a=5/0
b= 0 * Inf
c= Inf / Inf
d= 0 / 0 


% SECTION 6: Relational operators < > <= >= ~= ==
% note that ~= means not equal to?
%           == means equal to?

5 == 5
5 ~= 5
