how to change material slot name with code

hey, is there anyone know how to change material slot name with code?and i want to know how to change lod material with code, please help me.