I tried your code on my machine in both R2011a and R2014a, and as posted it is indeed quite a bit slower in R2014a. You can get nearly all the speed back if you make your code a function rather than a script. Seethis page for more about functions if you're not already used to writing them.
I assume you are referring to theSolar Cell block inSimElectronics. What are you trying to connect it to? If you look at the documentation, you'll see that it has 2 electrical ports from the Simscape foundation domain. You can therefore connect it to any Simscape or SimElectronics component that has electrical ports. The physical signal input to the block is the incident irradiance. You can use any Simulink signal for that, which you'll need to convert into a physical signal using theSimulink-PS Converter block.
Best Answer