I am feeding a signal q
into a MATLAB Function block - for example a sinusoid (it could be something else too). My MATLAB Function block also needs the time derivative of the signal. In Simulink I can do something like this:
However I'd like to forego the Derivative block (to conserve space, my actual model is much bigger than the above) and somehow get the derivative directly inside the MATLAB Function. For this I'd need to know the previous value of q
probably... which I can't know without adding a memory block.
Question : How do I get qdot
inside MATLAB Function without using any extra blocks (and removing the Derivative block above obviously)?
Thanks for your help!
q
? Can you calculate an analytical derivative of it? There is no "magic." If you need the derivative then you need to calculate the derivative one way or another. – horchler