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: partialmatch.m
    path of file: ./repos/Image-Harmonization-Dataset-iHarmony4/Xue et al/dependency/optprop/optutil
    
    the code of the file until where you have to start completion: function z=partialmatch(str,Options, noerr)
%PARTIALMATCH  Finds string matches á la Handle Graphics
%   Z=PARTIALMATCH(S,OPT) returns the string in OPT that either matches
%   exactly or unambiguously matches from the start. Comparisons are made
%   without regard to case. If no match can be established, an error is
%   raised.

    
function z=partialmatch(str,Options, noerr)
%PARTIALMATCH  Finds string matches á la Handle Graphics
%   Z=PARTIALMATCH(S,OPT) returns the string in OPT that either matches
%   exactly or unambiguously matches from the start. Comparisons are made
%   without regard to case. If no match can be established, an error is
%   raised.
%   Z=PARTIALMATCH(S,OPT, 'noerror') works like the previous but does not
%   raise an error if there is no match, instead an error message struct is
%   return with the field 'message' holding appropriate message.
%
%   Example:
%      partialmatch('abc',  {'Abc', 'abcdef'})
%      partialmatch('abcd', {'Abc', 'abcdef'})
%      partialmatch('ab'  , {'Abc', 'abcdef'})
%
%   See also: STRCMP, STRCMPI, STRMATCH, PARTIALINDEX

% Part of the OptProp toolbox, $Version: 2.1 $
% Author:  Jerker Wågberg, More Research & DPC, Sweden
% Email: ['jerker.wagberg' char(64) 'more.se']

% $Id: partialmatch.m 23 2007-01-28 22:55:34Z jerkerw $

	if nargin<3 || isempty(noerr)
		noerr=false;
	else
		if isempty(strmatch(lower(noerr), 'noerror'))
			error('partialmatch:IllPar', 'Third argument can only be empty or ''noerror''');
			end