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: partialPricingUpdate.m
    path of file: ./repos/linear-programming-using-MATLAB/codes/chapter6
    
    the code of the file until where you have to start completion: function [Sn] = partialPricingUpdate(A, c, BasicList, ...
	NonBasicList, BasisInv, tole, segmentSize)
% Filename: partialPricingUpdate.m

    
function [Sn] = partialPricingUpdate(A, c, BasicList, ...
	NonBasicList, BasisInv, tole, segmentSize)
% Filename: partialPricingUpdate.m
% Description: the function is an implementation of the 
% update routine for the static partial pricing method 
% using Dantzig's pivoting rule
% Authors: Ploskas, N., & Samaras, N.
%
% Syntax: [index] = partialpricingupdate(Sn, A, BasicList, ...
%	NonBasicList, BasisInv, tole, segmentSize)
% 
% Input:
% -- A: matrix of coefficients of the constraints 
%    (size m x n) 
% -- c: vector of coefficients of the objective function 
%    (size n x 1)
% -- BasicList: vector of indices of the basic variables
%   (size 1 x m)
% -- NonBasicList: vector of indices of the nonbasic 
%    variables (size 1 x (n - m))
% -- BasisInv: matrix with the basis inverse (size m x m)
% -- tole: the value of the tolerance for the pivoting step
% -- segmentSize: the size of the segment

% Output:
% -- Sn: vector of reduced costs (size 1 x (n - m))
%
% initialize vectors cb, cn, w and Sn
cb = c(BasicList);
cn = c(NonBasicList);
w = cb * BasisInv;
Sn = zeros(size(cn), 1);
currentSegment = 1; % initialize current segment
negativeFound = false;
Nend