Made RHY_stim2mat functional