Ok, I solved it by creating a new function handle to the S-function.
Smth like:
f = @(t,x,u,params)SfunctionName(t,x,u,1,params{:});
[Tk,Xk] = ode45(f, [T(k) T(k+1)], x, options, U(k), params);
Best
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!