Thermoelastic behavior in martensitic transformations