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: sw_intsf.m
    path of file: ./repos/spinw/dev
    
    the code of the file until where you have to start completion: function sFact = sw_intsf(sFact, varargin)
% integrates the structure factor along given Q directions
%
% sFact = SW_INTSF(sFact, 'Option1', Value1, ...) 
%

    
function sFact = sw_intsf(sFact, varargin)
% integrates the structure factor along given Q directions
%
% sFact = SW_INTSF(sFact, 'Option1', Value1, ...) 
%
% Options:
%
% axis      The index of the axis, along which the data is summed within
%           the given range. {1, 2, 3} is for {a*, b*, c*} respectively.
%           Zero is to powder average the data. Default is 1. More than one
%           axis can be given.
% range     Data range in r.l.u. along selected dimension to integrate,
%           default is the full data range.
% type      Type of data to be used for the integration.
%               'sf'    integrate the calculated structure factor. (default)
%               'perp'  integrate the perpend