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: icassoGet.m
    path of file: ./repos/gift/GroupICAT/icatb/toolbox/icasso122
    
    the code of the file until where you have to start completion: function out=icassoGet(sR,field,index)
%function out=icassoGet(sR,field,[index])
%
%PURPOSE 
%
%Auxiliary function for obtaining various information from the
%Icasso result data structure. Using icassoGet, you can return
%information related to original data, e.g.: data matrix,
%(de)whitening matrix, total number of estimates, number of
%estimates on each round. You can also return specified estimated
%independent components (sources), and rows of demixing matrices
%from. (However, it is easier to use function icassoResult to return
%the final estimation results from the complete Icasso pr
    
function will use a default value.] 
%
% sR    (struct) Icasso result data structure (from icassoEst).
% field (string) (case insensitive) determines what is returned: 
%    'data'           the original data centered 
%    'N'              the number of estimation cycles
%    'M'              the total number of estimates available;
%                     equal to sum(icassoGet(sR,'numofic'));
%    'numofic'        number of ICs extracted on each cycle (Nx1
%                     vector) 
%    'odim'           original data dimension
%    'rdim'           reduced data dimension (after PCA)
%    'round'          output is an Mx2 matrix that identifies from
%                     which estimation  round each estimate
%                     originates:  
%                     out(i,1) is the estimation round for 
%                     estimate i, 
%                     out(i,2) is the ordinal number of the
%                     estimate within the round.
%    'source'         estimated source signals 
%    'dewhitemat'     dewhitening matrix for the original data
%    'whitemat'       dewhitening matrix for the original data
%    'demixingmatrix' demixing matrix rows ('W' works as well)
%
% [index] (vector of integers) specifies which estimates to return 
%          Applies only for 'demixingmatrix', and 'source'
%          Default: leaving this argument out corresponds to
%          selecting all estimates, i.e., giving [1:M] as index
%          vector. 
%
%OUTPUT
%
% out   (type and meaning vary according to input argument 'field')
%
%SEE ALSO
% icassoResult


%COPYRIGHT NOTICE
%This function is a part of Icasso software library
%Copyright (C) 2003-2005 Johan Himberg
%
%This program is free software; you can redistribute it and/or
%modify it under the terms of the GNU General Public License
%as published by the Free Software Foundation; either version 2
%of the License, or any later version.
%
%This program is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%GNU General Public License for more details.
%
%You should have received a copy of the GNU General Public License
%along with this program; if not, write to the Free Software
%Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

% ver 1.2 100105

M=size(sR.index,1);

if nargin<3,
   index=1:M;
end