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: mosaic.m
    path of file: ./repos/Computer-Vision-and-AI/Panoramic-Image-Stitching
    
    the code of the file until where you have to start completion: function [J] = mosaic(images,basePts,inputPts)
% mosaic - stich multiple images together given a set of coorisponding
%      points between the images
%
% [J] = mosaic(images,basePts,inputPts)
%
% INPUTS
%   images - cell array of images to be mosaiced
%   basePts - cell array of coordinates for given image
%   inputPts - cell array of coordinates for matching points in next image
% OUTPUT
%   J - the single mosaiced picture

% TJ Keemon <keemon@bc.edu>
% December 2007

num = numel(images);

    
function [J] = mosaic(images,basePts,inputPts)
% mosaic - stich multiple images together given a set of coorisponding
%      points between the images
%
% [J] = mosaic(images,basePts,inputPts)
%
% INPUTS
%   images - cell array of images to be mosaiced
%   basePts - cell array of coordinates for given image
%   inputPts - cell array of coordinates for matching points in next image
% OUTPUT
%   J - the single mosaiced picture

% TJ Keemon <keemon@bc.edu>
% December 2007

num = numel(images);
H = cell(1,num);
H{1} = eye(3);
warpedImages = cell(num);

for i = 2:num
    H{i} = computeHomography(inputPts{i-1}(:,1),inputPts{i-1}(:,2), ...
        basePts{i-1}(:,1), basePts{i-1}(:,2));
end