I would like to create a simulation libary which has in principle two types of blocks, a "calculation block" and a "stream information block". The idea being that you load up the calculation blocks and then add intermediary "stream blocks" which you use to read back the data and present it to the used (I don't need all the streams only a couple). The conncector streams running between the calculation blocks is a user generated bus (i.e. there are diffent value sets running on the bus). I am not interested in the running time data, only the after simulation has stopped data (i.e. a single point after the model converges),
My challange is that I cannot see how to extract the data from each of the simulink streams (or alternatively from a library block). I would have liked to use something like get_param(gcb, 'CurrentValue') of an output port to strip the current values straight out of the port but it seems that the only way is to the the "To Workspace" block. However, I can't put the a "To Workspace" becasue the it is creates a single workspace variable (simout) and I cannot modify the variable name as it sits within a libary block. I also can't set the stream to "log data" (it seems) and therefore I can't extract the data stream.
Broadly this question is to see if there is a way to access simulink stream or block data from the command line? (or a work around to be able to rename a workspace varible sitting inside a library block)