You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: xASL_im_rotate.m
    path of file: ./repos/ExploreASL/Functions/ImageProcessing
    
    the code of the file until where you have to start completion: function rotated = xASL_im_rotate(im, angle)

    
function rotated = xASL_im_rotate(im, angle)
%xASL_im_rotate Simple rotation of the first two dimension of a ND image by 0,90,180,270 degrees
%
% FORMAT:       rotated = xASL_im_rotate(im, angle)
% 
% INPUT:        im - an ND image
%               angle - angle of rotation in the first two dimensions, can be either 0,90,180,270 or other multiple of 90
%
% OUTPUT:       rotated - rotated image of the same dimensions
% 
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION:  Simple rotation of the first two dimension of a ND image by
%               0, 90, 180, 270 degrees.
%
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% EXAMPLE:      ...
% __________________________________
% Copyright 2015-2020 ExploreASL

% In case the angle is higher than 360 or smaller than 0
angle = mod(angle,360);

% Skip empty images
if (isempty(im)) 
    rotated = im;
    return;
end