 j=1:n
        I = reshape(X(i,:),m,m);
        [Dx,Dy] = create_distortion_map(I,sig,alpha);
        I = distort_image(I,Dx,Dy);
        X2(index,:) = I(:)';
        y2(index) = y(i);
        index = index+1;
    <span class="keyword">end</span>
    X2(index,:) = X(i,:);
    y2(index) = y(i);
    index = index+1;
<span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">function</span> test_distortion(I,sig,alpha,gausswidth)
[Dx,Dy] = create_distortion_map(I,sig,alpha,gausswi