UMaterialInstanceDynamic vc UMaterialInstance

If I have a material with a parameter, and instance of that material and I want to change the value of that parameter in C++, which class do I have to use UMaterialInstanceDynamic or UMaterialInstance?