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

조회 수: 2 (최근 30일)
Rafael Cordero
Rafael Cordero 2020년 7월 17일
답변: Rafael Cordero 2020년 7월 20일
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