The best way to do this is to use Variable R, L, C blocks. In Simscape electrical such blocks are available in both Simscape implementation and Specialized Power Systems. See the following resources:
- Variable Resistor, Variable Capacitor, Variable Inductor in Simscape
- Variable Resistor, Variable Capacitor, Variable Inductor in Specialized Power Systems