How to get the weight matrix after each iteration in Matlab neural network?

Using train () / sim (), after each iteration, the data in the LW and IW matrices are overwritten and only the latter are available. Is there a way to get them during training (or testing)?