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: tile.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/rutgers/utility
    
    the code of the file until where you have to start completion: function [Istr,Iend,Jstr,Jend]=tile(Lm,Mm,NtileX,NtileE,ti
    
function computes parallel tile partitions in grid units.
%
% On Input:
%
%    Lm          Number of interior RHO-points in the I-direction
%    Mm          Number of interior RHO-points in the J-direction
%    NtileI      Number of parallel partitions in the I-direction
%    NtileJ      Number of parallel partitions in the J-direction
%    tile        Tile number (0 <= tile <= NtileI*NtileJ-1)
%    verbose     display information (optional, default=true)
%
% On Output:
%
%    Istr        Starting tile I-direction index
%    Iend        Ending   tile I-direction index
%    Jstr        Starting tile J-direction index
%    Jend        Ending   tile J-direction index
%

% svn $Id: tile.m 938 2019-01-28 06:35:10Z arango $
%===========================================================================%
%  Copyright (c) 2002-2019 The ROMS/TOMS Group                              %
%    Licensed under a MIT/X style license                                   %
%    See License_ROMS.txt                           Hernan G. Arango        %
%===========================================================================%

verbose=true;

switch numel(varargin)
  case 1
    verbose=varargin{1};
end

%---------------------------------------------------------------------------
% Compute tile(s) starting and ending indices.
%---------------------------------------------------------------------------

ChunkSizeX=floor((Lm+NtileX-1)./NtileX);
ChunkSizeE=floor((Mm+NtileE-1)./NtileE);
MarginX=floor((NtileX.*ChunkSizeX-Lm)./2);
MarginE=floor((NtileE.*ChunkSizeE-Mm)./2);

jtile=floor(tile./NtileX);
itile=tile-jtile.*NtileX;

Istr=1+itile.*ChunkSizeX-MarginX;
Iend