How can I make an enabled "to workspace" using just a variable-size signal?

1 次查看(过去 30 天)
Hello world!
I have a sequential signal processing model. It processes input biosignals in frames, and then outputs a series of outputs to the Matlab workspace.
One of these outputs is a variable-size signal created using a Matlab Function block.
I've been using enabled subsystems a lot because otherwise the various processing stages are performed even when there is no signal. I use the frames with the signal themselves as the enable signals. If they are non-zero: the processing block/stage is enabled.
Similarly, I wolud like to have an enabled 'To Workspace' subsystem so that only the meaningful outputs are passed to the workspace (and not a series of zeroes essentially). Normally this works fine. However, the enable doesnt like variable-size signals, so I cannot seem to output my variable-size signal with this enabled 'To Workspace' scheme. I have tried to get around this using "tricks" like compare-to-zero blocks, if statements, but these blocks also dont like variable-size signals.
Does anyone have any ideas or solutions?
Thanks,
Rafael

回答(1 个)

Rafael Cordero
Rafael Cordero 2020-7-20
In the end I just used a selector to force the variable-size signal into a fixed-size (of length equal to the original variable-size signal).
Kinda weird though, I had to say the input had a dimensionality of 2 (even though its only 1) for it to work.

类别

Help CenterFile Exchange 中查找有关 Subsystems 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by