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: spm_cost_SHC_path.m
    path of file: ./repos/bspm/thirdparty/spm12/toolbox/DEM
    
    the code of the file until where you have to start completion: function spm_cost_SHC_path(qU,A)
% plots path for cost_SHC demo's
% FORMAT spm_cost_SHC_path(qU,A)
%
% qU  - DEM condotioal esimates of states
% A.x - locations of attrcuor
% A.d - radius
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Karl Friston
% $Id: spm_cost_SHC_path.m 3757 2010-03-08 11:41:53Z guillaume $

% plot
%==========================================================================
[X Y Z] = sphere;

% plot path
%--------------------------------------------------------------------------
x     = qU.v{1}(1:2,:);
plot(A.x(1,:),A.x(2,:),'c.','MarkerSize',64), hold on
plot(x(1,:),x(2,:));    
plot(x(1,:),x(2,:),'.','MarkerSize',8);     

% plot locations
%--------------------------------------------------------------------------
% for i = 1:size(A.x,2)
%     surf(X*A.d + A.x(1,i),Y*A.d + A.x(2,i),Z*A.d - 8)
% end
% shading interp


axis([-4 4 -4 4])
axis square
title('trajectory','FontSize',16),hold off

    
function spm_cost_SHC_path(qU,A)
% plots path for cost_SHC demo's
% FORMAT spm_cost_SHC_path(qU,A)
%
% qU  - DEM condotioal esimates of states
% A.x - locations of attrcuor
% A.d - radius
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Karl Friston
% $Id: spm_cost_SHC_path.m 3757 2010-03-08 11:41:53Z guillaume $

% plot
%==========================================================================
[X Y Z] = sphere;

% plot path
%--------------------------------------------------------------------------
x     = qU.v{1}(1:2,:);
plot(A.x(1,:),A.x(2,:),'c.','MarkerSize',64), hold on
plot(x(1,:),x(2,:));    
plot(x(1,:),x(2,:),'.','MarkerSize',8);     

% plot locations
%--------------------------------------------------------------------------
% for i = 1:size(A.x,2)
%     surf(X*A.d + A.x(1,i),Y*A.d + A.x(2,i),Z*A.d - 8)
% end
% shading interp


axis([-4 4 -4 4])
axis square
title('trajectory','FontSize',16),hold off

% occupancy
%--------------------------------------------------------------------------
for i = 1:size(A.x,2)
    for j = 1:2
        d(j,:) = x(j,:) - A.x(j,i);
    end