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: NMPC_TT.m
    path of file: ./repos/MPC-Implementation/NMPC for target tracking
    
    the code of the file until where you have to start completion: % This code is for the implementation of the MPC for th
    
function
g = [];  %constrains of pitch angle theta

%{
for k=1:N
    stt = X(1:2,1:N); reference(1:2,k);
    obj = obj + sqrt((stt(1,k)-reference(1,k))^2 + (stt(2,k)-reference(2,k))^2);
end