function Cdu = computeCdeltau(nu)
    Cu_tmp1 = cell(nu,nu);
    Cu_tmp2 = cell(nu,nu);
    
    for i=1:nu
       for j=1:nu 
          if i==j
              Cu_tmp1{i,j} = eye(2);
              Cu_tmp2{i,j} = -eye(2);
          else
              Cu_tmp1{i,j} = zeros(2,2);
              Cu_tmp2{i,j} = zeros(2,2);
          end
       end
    end
    
    Cdu = [cell2mat(Cu_tmp1);cell2mat(Cu_tmp2)];
end
ccalas
github-repos/MATLAB/ccalas-mpc/mpc-2b30095dc94efb7799e861eb5acc6fe02110a328/computeCdeltau.m
mpc
github-repos/MATLAB/ccalas-mpc
2b30095dc94efb7799e861eb5acc6fe02110a328