%%-- 11/30/2016 9:07 AM --%
% This is my command history -- everything I typed while demoing during lab.
% IT DOES contain errors.
x = [1 2 3 4]
x = [1 2 3 4; 1 2 3 4]
imshow(x)
imagesc(x)
x = [1 2 3 4; 5 6 7 8]
imagesc(x)
x(2,4)
for i=0:3
print(x(i,1))
end
for i=1:4
print(x(i,1))
end
for i=1:4
disp(x(i,1))
end
for i=1:4
disp(x(1,i))
end
disp(x(1,:))
imagesc(x(1,:))
shg
x(1,1:2)
x(1:2,1:2)
x(1:2,3:4)
x(1:2,3:4);
x(1:2,3:4)
ones(2)
ones(3)
2*ones(3)
4*ones(3)
5*ones(3)
0*ones(3)
zero(3)
zeros(3)
zeros(5)
zeros(5,2)
zeros(2,5)
I = zeros(100,200);
imshow(I)
shg
I = ones(100,200);
imshow(I)
shg
I(97:100,197:100)
I(97:100,197:200)
197:100
197:-1:100
I(97:100,197:-1:100)
I(97:100,197:2:200)
197:200
197:2:200
I(97:100,197:200)
I(97:100,197:200) = 0
imshow(I)
shg
I(1:2:100,1:2:200)
size(I(1:2:100,1:2:200))
I(1:2:100,1:2:200) = 0
imshow(I)
shg
I(2:2:end,2:2:end) = 0.5
imshow(I)
row = [1 2 3 4]
col = [2;3;5;7]
col = [2 3 5 7]'
col = [2 3 5 7]''
col = [2 3 5 7]'
ros
row
row*col
col*row
A = [0 0 0 0; 0 1 0 1]
B = [1 1 1 0; 0 0 0 0]
A + B
A .* B
A * B
A .^ B
A
B
A .^ B
0^0
0^0.1
0^eps
0^(eps-eps)
0^(-10*eps:10*eps)
0^((-10*eps):(10*eps))
0.^((-10*eps):(10*eps))
((-10*eps):(10*eps))
((-10*eps):eps:(10*eps))
0^((-10*eps):eps:(10*eps))
0.^((-10*eps):eps:(10*eps))
small = (-10*eps):eps:(10*eps);
[ii,jj] = ndgrid(small,small)
ii.^jj
zz = ii.^jj;
rr = real(zz)
im = image(zz)
im = imag(zz)
mesh(ii,jj,rr)
mesh(ii,jj,imag)
mesh(ii,jj,im)
shg
aa = abs(zz);
mesh(ii,jj,aa)
shg
figure
th = angle(zz)
mesh(ii,jj,th)
shg
title('magnitude')
title('angle')
figure(1)
title('magnitude')
figure(2)
title('angle')
shg
commandhistory
