% Script ImageDemo
% Illustrates imread, image, imwrite, and imshow

close all

% Convert the jpeg image to uint8 array and determine its dimensions
A = imread('LawSchool.jpg');
[m,n,p] = size(A);

% Set up a big figure and display the image
figure
set(gcf,'position',[100 100 800 600])
image(A)
shg
pause

% Produce a "left-right" mirror image, display, and store...
B = A(:,n:-1:1,:);
figure
set(gcf,'position',[100 100 800 600])
image(B)
imwrite(B,'LawSchoolMirror.jpg')
shg
pause

% Produce an upside down mirror image, display, and store...
C = A(m:-1:1,:,:);
figure
set(gcf,'position',[100 100 800 600])
image(C)
imwrite(C,'LawSchoolUpDown.jpg')
shg
pause

clear all
% Use imshow to display image file with w/o using the workspace
for i=1:5
imshow('LawSchoolMirror.jpg')
pause(.5)
imshow('LawSchoolUpDown.jpg')
pause(.5)
imshow('LawSchool.jpg')
pause(.5)
end