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: mk_hhmm2.m
    path of file: ./repos/bnt/BNT/examples/dynamic/HHMM/Old
    
    the code of the file until where you have to start completion: function bnet = mk_hhmm2(varargin)
% MK_HHMM2 Make a 2 level Hierarchical HMM

    
function bnet = mk_hhmm2(varargin)
% MK_HHMM2 Make a 2 level Hierarchical HMM
% bnet = mk_hhmm2(...)
%
% 2-layer hierarchical HMM  (node numbers in parens)
%
%   Q1(1) ---------> Q1(5)
% /  | \            / |
% |  |  v          /  |
% |  |  F2(3) --- /   |
% |  |  ^         \   |
% |  | /           \  |
% |  v              \ v
% |  Q2(2)--------> Q2 (6)
% |  |    
% \  | 
%  v v    
%   O(4)
%
%
% Optional arguments [default]
%
% discrete_obs - 1 means O is tabular_CPD, 0 means O is gaussian_CPD [0]
% obsCPT       - CPT(o,q1,q2) params for O ['rnd']
% mu           - mu(:,q1,q2) params for O [ [] ]
% Sigma        - Sigma(:,q1,q2) params for O [ [] ]
%
% F2toQ1       - 1 if Q2 is an hhmm_CPD, 0 if F2 -> Q2 arc is absent, so level 2 never resets [1]
% Q1args        - arguments to be passed to the constructors for Q1(t=2) [ {} ]
% Q2args        - arguments to be passed to the constructors for Q2(t=2) [ {} ]
%
% F2 only turns on (wp 0.5) when Q2 enters its final state.
% Q1 (slice 1) is clamped to be uniform.
% Q2 (slice 1) is clamped to always start in state 1.

[os nmodels nstates] = size(mu);

ss = 4;
Q1 = 1; Q2 = 2; F2 = 3; obs = 4;
Qnodes = [Q1 Q2];
names = {'Q1', 'Q2', 'F2', 'obs'};
intra = zeros(ss);
intra(Q1, [Q2 F2 obs]) = 1;
intra(Q2, [F2 obs]) = 1;

inter = zeros(ss);
inter(Q1,Q1) = 1;
inter(F2,Q1) = 1;
if F2toQ2
  inter(F2,Q2)=1;
end