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: mask_intersection.m
    path of file: ./repos/CanlabCore/CanlabCore/Image_computation_tools
    
    the code of the file until where you have to start completion: function [vol,V,XYZ,clusters,Q] = mask_intersection(clsize,outname,i1,i2,varargin)
% empty i1 prompts for graphic selection of filenames
% extra arguments are more file names for 3 - n-way intersection
% empty outname prompts for entry of output img file name
%
% :Usage:
% ::
%
%     function [vol,V,XYZ,clusters,Q] = mask_intersection(clsize,outname,i1,i2,varargin)
%
% ..
%    by Tor Wager
% ..

    
function [vol,V,XYZ,clusters,Q] = mask_intersection(clsize,outname,i1,i2,varargin)
% empty i1 prompts for graphic selection of filenames
% extra arguments are more file names for 3 - n-way intersection
% empty outname prompts for entry of output img file name
%
% :Usage:
% ::
%
%     function [vol,V,XYZ,clusters,Q] = mask_intersection(clsize,outname,i1,i2,varargin)
%
% ..
%    by Tor Wager
% ..

% ..
%    get file names and calcstr to evaluate
% ..

calcstr = 'i1 .* i2';

if isempty(i1),
	P = spm_get(Inf,'*.img','Select binary mask images to intersect',pwd,0);

	if size(P,1) < 1, error('Must select at least 2 images'), end