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: caldate.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 [Date]=caldate(Julian);

%
% CALDATE:  Converts Julian day numbers to calendar date
%
% [Date]=caldate(Julian);
%
% This fu
    
function converts Julian day number to calendar date structure.
%
% On Input:
%
%    Julian      Julian day number
%
% On Output:
%
%    Date        Calendar (Gregorian) date (structure array):
%                  Date.year  =>  year
%                  Date.yday  =>  year day
%                  Date.month =>  month
%                  Date.day   =>  day of the month
%                  Date.hour  =>  decimal hours
%                  Date.min   =>  minutes
%                  Date.sec   =>  seconds
%

% svn $Id: caldate.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        %
%===========================================================================%

% Check fom modified Julian day.  Modified Julian day beggins at 
% Julian Day 2440000 (0000 hours, May 23, 1968).

JulDay=Julian;
if (length(JulDay) == 1),
 if (JulDay < 2440000 ),
   JulDay=JulDay+2440000;
 end,
else,
  for i=1:length(JulDay),
    if (JulDay(i) < 2440000 ),
      JulDay(i)=JulDay(i)+2440000;
    end