function [ TH, N_STATES ] = combinetransitions( N_STATES1, TH1, N_STATES2, TH2)
% Combine transition matrices for the HEART behaviors
N_STATES=N_STATES1+N_STATES2;

first_th1=TH1(1,1);
first_th2=TH2(1,1);

TH=[TH1;TH2];

TH(N_STATES1,2)=first_th2;
TH(N_STATES1+N_STATES2,2)=first_th1;
end

