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: ica.m
    path of file: ./repos/CanlabCore/CanlabCore/@image_vector
    
    the code of the file until where you have to start completion: function icadat = ica(fmridat_obj, varargin)
% Spatial ICA of an fmri_data object
%   - icadat = ica(fmridat_obj, [number of ICs to save])
%   - icadat is also an fmri_data object, with .dat field voxels x components
%
% :Notes:
%   - Spatial component maps are saved in columns of icadat.dat, or rows of icadat.dat'
%   - icasig = W * mixedsig
%   - icasig = icadat.dat' = W * fmridat_obj.dat'
%
% W is the separation matrix, the inverse of the mixing matrix
% A is the mixing matrix, the inverse of the separation matrix
% 
% A and W are stored in additional_info field of icadat in cells {1} and {2}, respectively
% A = ica_obj.additional_info{1};
% W = ica_obj.additional_info{2};
%
% Model:

    
function icadat = ica(fmridat_obj, varargin)
% Spatial ICA of an fmri_data object
%   - icadat = ica(fmridat_obj, [number of ICs to save])
%   - icadat is also an fmri_data object, with .dat field voxels x components
%
% :Notes:
%   - Spatial component maps are saved in columns of icadat.dat, or rows of icadat.dat'
%   - icasig = W * mixedsig
%   - icasig = icadat.dat' = W * fmridat_obj.dat'
%
% W is the separation matrix, the inverse of the mixing matrix
% A is the mixing matrix, the inverse of the separation matrix
% 
% A and W are stored in additional_info field of icadat in cells {1} and {2}, respectively
% A = ica_obj.additional_info{1};
% W = ica_obj.additional_info{2};
%
% Model:
% D = A * S, where:
%   D = [n x v] dataset, images x voxels in fmridat_obj.dat'
%   A = [n x k] mixing matrix (the inverse of the separation matrix if n = k)

%   W = [k x n] separation matrix, (the inverse of the mixing matrix if n = k)
%               W' is a matrix whose columns are image series, e.g., time
%               series. They reflect the expression of each component
%               across images and can be used to analyze differences across
%               image groups (conditions, time, etc.)
%   S = [k x v] components matrix, with k components. S = icadat.dat'
%               S = W * D;
%
% - Each image in D is a mixture of maps S defined by a row of A
% - Each column of A defines the expression of one map in S across images (e.g., time, or other image series)
%
% Reconstructed data:
% D_recon = A * S;
% figure; plot(D(:), D_recon(:), 'k.')
%   A is related to D * S' (fmridat_obj.dat' * icadat.dat)';
%
% Dual regression / back-reconstruction:
% B = pinv(S') * D';  % dual regression step 1, each data image n regressed on k spatial maps S; B = k x n
% B = pinv(icadat.dat) * fmridat_obj.dat;
%   Note: fmridat_obj can be a different image object here, e.g., an independ