If your power system model in Simulink is constructed using only the Basic Blocks, then I'm unsure if the Jacobian can be computed using S-Function.
Computing the Jacobian matrix of a function requires a mathematical model. Since MATLAB is good for handling mathematical expressions, it is advisable to compute the Jacobian in MATLAB environment and then pass the solution (using a user-defined Jacobian) to Simulink environment for evaluation.
Else, try approximating the Jacobian using the finite difference method. The following articles may be helpful in computing the Jacobian.