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: ObsRecGen.m
    path of file: ./repos/PsPM/src/ext/VBA/subfunctions
    
    the code of the file until where you have to start completion: function [ gx ] = ObsRecGen(x,P,u,in)
% Marie devaine wrote this
% ObsRecGen obsevration function general for recursive ToM
%   This one is the simplest one and does not include bias
% x are the hidden states
% P is the temperature
% u is useless here can be left empty
% in contains important information such as the level of the player, its
% role and the game nb total de para
player= in.player; % 1 or 2: role of the player
ntotPara= in.npara;
lev=in.lev;
game=in.game;
alpha=0.36;
indlev=in.indlev;

    
function [ gx ] = ObsRecGen(x,P,u,in)
% Marie devaine wrote this
% ObsRecGen obsevration function general for recursive ToM
%   This one is the simplest one and does not include bias
% x are the hidden states
% P is the temperature
% u is useless here can be left empty
% in contains important information such as the level of the player, its
% role and the game nb total de para
player= in.player; % 1 or 2: role of the player
ntotPara= in.npara;
lev=in.lev;
game=in.game;
alpha=0.36;
indlev=in.indlev;

if lev==0
    muT=x(1);
    SigT=exp(x(2));
    Pi= sigmoid( muT/(sqrt(1+alpha*SigT)));
else
    vecp=sigmoid(x(1:(lev-1)));
    vecp(end