function [ K ] = setStiffnessMatrix(kVector)
% [ K ] = setStiffnessMatrix(kVector) SETKMATRIX - set's entries of full tri-diagonal Stiffness 
%  matrix given an input vector of spring coefficents k
%   
% kVector - vector of spring constants
% K       - full tridiagonal matrix with interior rows 
%                -k(i) (k(i)+k(i+1)) -k(i+1)
   
   k = kVector(:); % convert to column vector
      
      
   n = length(k);  % number of springs
   K=zeros(n); % allocate Full n x n matrix (bad idea really, should use spalloc)
   K(1,1:2)= [ (k(1)+k(2)) -k(2) ];
   for i=2:n-1
      K(i,[i-1:i+1]) = [ -k(i) (k(i) + k(i+1)) -k(i+1) ];
   end
   K(n,n-1:n) = [ -k(n) k(n) ];
   
   return
  
   
