Before I answer your main question—if meditation or yoga is helpful soon after working out—let me first address your claim about it causing an irregular heartbeat: your heart will increase gradually (or at least continuously) while your body endures stress from intense physical activity, and it will decrease gradually when practicing a physiologically calming action such as meditation; there should be no sudden increase or decrease in heart rate that could produce similar negative effects to experiencing a medically irregular heartbeat.
Just because meditation after working out won't kill you, doesn't mean it's helpful either. Meditation involving limited to no movement is not optimal for allowing your body to recover from the stress of an intense workout. Gentle and moderate movement involved in cooldowns is important for the following reasons:
- It prevents dizziness or fainting caused by blood pooling in your extremities
- Helps your muscles clear lactic acid buildup
- Aids in reducing tensions from tightly contracted muscles
Yoga could be far more effective in cooling down, depending on the style and type of movements. When cooling down, it is important that you are moving to achieve optimal results; yoga that involves lengthy static holds would not be optimal immediately after working out, but stretching in short repetitions can help to gradually relax muscles and maintain flexibility and range of motion.
Hope this helps!