S Function : How to output the derivatives

Hello,
I'm integrating the equations of a dynamic system with a S function. The code looks like that:
switch flag
case 0
% Initialization
case 1
% Here I calculate dV/dt
case 3
% Here I output the V calculated by the S function
%...
end
I would not only like to output V, but also the dV/dt calculated in case 1.
Is it possible?
Thank you.

Antworten (1)

Kaustubha Govind
Kaustubha Govind am 18 Mai 2012

1 Stimme

I don't think this is possible in a Level-1 MATLAB S-function, but in a Level-2 MATLAB S-function, you might be able to create a Discrete State DWork and store the same value in it.

Kategorien

Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Gefragt:

Mr
am 16 Mai 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by