Variant Subsystem variant control condition defined by previous subsystem output

조회 수: 9 (최근 30일)
How can I use a previous block output as the the control variable ? (connecting the constant value output to the variant subsystem is useless because the conditions variables are supposed to be determined by base-workspace variables in the case of variant subsystems)
Error evaluating properties of Simulink.Variant object 'a' in workspace 'base' (used by block '....../Variant Subsystem')
Caused by: Variant condition 'ind==1' should return a logical value Attempt to reference field of non-structure array.
http://www.mathworks.com/matlabcentral/answers/69974-writing-value-to-workspace-and-taking-that-value-from-workspace-to-be-used-in-another-model-part So I understand variant subsystems aren't helpful for parameters that aren't constant during simulation, but what about parameters that are determined only at the beginning of the simulation?
by the way: I tried using Block priorites+ To workspace block, But I was limited by the condition variable type int8 (Timeseries form, couldn't change it), so that ind.Data==int8(1) didn't work as a condition....

채택된 답변

Guy Rouleau
Guy Rouleau 2013년 8월 19일
This is not what variant subsystems have been designed for. Use a if-else construct, a Switch, or other options like the ones I described here:
  댓글 수: 1
Idan
Idan 2013년 8월 19일
편집: Idan 2013년 8월 19일
For somehow I still don't understand in which cases variant subsystems are helpfull (only one execution path determined by base workspace variable? / Is it for static configuration of the simulation?)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by