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: MPCsim.m
    path of file: ./repos/AutomationShield/matlab/examples/BoBShield
    
    the code of the file until where you have to start completion: startScript
%define LQR
Ts=0.01;
load('myModel.mat')%load model
%create s
    
function from "zaklady prediktivnej..."

X = dx0;%initial state, I guess
XI=0; %initial integrator state
opts = optimset('Algorithm','interior-point-convex','Display','off'); %optimization options

%simulation
for i = 1:poc
    Xn(:,i)=[X(:,i);XI]; %update extend