MATLAB: Does the ‘LoadFcn’ Callback of a commented block get executed

simulink

Why does the 'LoadFcn' Callback of a commented block get executed? 

Best Answer

We can classify the block callbacks in 2 categories: edit time and run time.
Edit time callbacks like the 'LoadFcn' callback need to execute even if the block is commented out. Just to display the commented block in the model, the block needs to be loaded, and the load callback is triggered. A similar behavior is observed with the 'DeleteFcn' and 'DestroyFcn' callbacks. 
On the other hand, callbacks that are runtime (not needed for editing) like 'InitFcn' and 'StartFcn' are not triggered for commented out blocks and inactive variants.