If energy is added or subtracted, a state change might occur. However, there will not be a net addition or subtraction of matter: matter is always conserved even through state changes. This can be seen when water freezes or vaporizes, depending on the beginning phase and the amount of energy applied.