I have a model of a back-to-back converter, out of which I'm sending two variables to my Matlab workspace (the last 200.000 values, since with the sample time of 0.0000001s it is only all the values from a complete period). I run the simulation once, and then I have two variables in my workspace. I'm using these variables as vector and I'm calculating a few things with them, like calculating the RMS of one and taking the Max value minus the min value of the other vector, and a bit more and giving these two single (!) values that I get into another Matlab Function that returns one value.
Now I want that to happen on the go, during a Simulation (Tsim = inf). I know that I can pause a Simulation, calculate and then continue, but is there an option to do all this on the go?
The Matlab Function block seems to be the right way, but I have the problem that I need the last 200.000 values of a current, not only the one current value of it.
So how do I save 200.000 values into a vector, inside a Matlab-Function-Block to use them in real (simulation) time? I don't want to do anything with the result of the Function, only display it.
Doing all the calculations in Simulink Blocks doesn't seem to be a good way either, especially since I need one RMS Value of the current, which is not working because of some error because of the sample time...