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: ocid.m
    path of file: ./repos/MataveID/matave/+mi
    
    the code of the file until where you have to start completion: % Observer Controller Identification
% Input: r(reference signal), uf(feedback signal), y(output signal), sampleTime, alpha(filtering integer parameter), regularization(optional), systemorder(optional)
% Output: sysd(Discrete state space model), K(Kalman gain matrix)
% Example 1: [sysd, K, L] = mi.ocid(r, uf, y, sampleTime, alpha, regularization, systemorder);
% Example 2: [sysd, K, L] = mi.ocid(
    
function will find markov parameters Y11 and Y12 from Ybar11 and Ybar12
% In this example, we indexing from 1, not 0.
function [Y11, Y12] = getMarkovCAB_CAG(Ybar11, Ybar12, D, p)
  Y11 = zeros(1, p);
  Y12 = zeros(1, p);
  for k = 1:p

    % Find the Ybar11 and Ybar12
    Ybar11_k = Ybar11(k);
    Ybar12_k = Ybar12(k);

    % Sum
    Y11sum = 0;
    Y12sum = 0;
    for i = 1:k
      if(k-i == 0)
        Y11sum = Y11sum + Ybar12(i)*D; % Y11(0) = D
      else
        Y11sum = Y11sum + Ybar12(i)*Y11(k-i);
      end