How do I get the minor time in a MATLAB s-function?
Mostrar comentarios más antiguos
Inside a Level-2 Matlab S-function, block.CurrentTime gives the value of the major time. How can we get the value of the minor time?
Respuesta aceptada
Más respuestas (2)
Guy Rouleau
el 27 de Mayo de 2011
0 votos
I recommend looking at this submission:
It contains a level-2 MATLAB s-function which reads and separate values from major and minor steps.
I use the files in this submission often to better understand continuous solver behavior. Just for my curiosity, can you provide more details on why you want to access minor time steps data?
tianyuan wang
el 9 de Mzo. de 2023
0 votos
I encountered a similar problem.
If I choose the ode4 solver, does the model loop four times in one time step?
Another question is, if I use S-function in my model and call S-function once in a time step, how does ode4 extrapolate the results of S-functions? Does the result of the S-function have to be a function of time t? Or Simulink automatically extrapolate based on the value of S-function?

Categorías
Más información sobre Simulink en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!