Plasma control by pattern recognition in laser induced breakdown spectroscopy