Robust solution of .putDataFromVariable (storage via .MAT file)