i make a simulation to a gibbs sampling algorithm and the following code is part of the simulation :
mamodel=@(x)find(ismember(x(:,2:end),[1 0 0 0 0],'rows'))
if ~isempty(a)
macount=a(mamodel(a),:)
else
macount=zeros(1,size(a,2))
end
h(i,:)=(macount)
the first line is to find a certain row from simulation results the problem is when this row is not in the results the smulation stops because the result is Empty matrix: 0-by-6 , i tried isempty function and also the simulation stops!! i want to make the simulation ignore the results and continue to next step