% affine transformation shear 
clear
x = [2 1 3 4;
    1 1 2 3;
    4 2 1 3;
    2 2 3 1] % input
w = [1 1 0; 0 1 0; 0 0 1] % shear
tform=maketform('affine',w);
out = imtransform(x',tform,'nearest')' % output









