update mat file