Analogy between spinodal decomposition and martensitic transformation