function supersampled_image = mSupersampleAverage( image ) [ row_max, col_max ] = size( image ); row_max = row_max * 2; col_max = col_max * 2; supersampled_image = zeros( row_max, col_max ); supersampled_image( 1:2:row_max, 1:2:col_max ) = image; supersampled_image( 2:2:row_max, 1:2:col_max ) = image; supersampled_image( 1:2:row_max, 2:2:col_max ) = image; supersampled_image( 2:2:row_max, 2:2:col_max ) = image;