datetime('10:30 AM','InputFormat','hh:mm a')
Notice how the current day is automatically used. MATLAB does not have any datatype for pure clock time without a date: it has datetime (that can be configured to display nor not display the date or seconds or whatever even though they are stored); and it has duration() objects that are purely relative objects with no date or absolute hour, just elapsed time.
You can do
temp = datetime('10:30 AM','InputFormat','hh:mm a')
day_relative = temp - dateshift(temp, 'start', 'day')
and now you have a duration relative to the beginning of the day.