Simulink Conditional Execution with From Workspace Block
9 ビュー (過去 30 日間)
古いコメントを表示
I am trying to setup a simple conditional execution where based on a test one of two From Workspace blocks is selected i.e., is test is true then I want to load data1 from workspace while if test is false I want to load data2. My problem is that only data1 or data2 will be present in the workspace (and it will correspond to the test condition). When I try to run the simulation, I get a variable not found error for the missing data1 or data2 even though based on the test condition that From Workspace block will not have to be executed. I was expecting the conditonal input branch execution to take care of this and not bother about the From Workspace block for the condition that will not be run. I have tried to acheive this in many ways including switch block, enabled subsystem, if and if action blocks but everytime I am getting the same issue.
What am I doing wrong and how can I solve this problem?
0 件のコメント
回答 (1 件)
TAB
2012 年 6 月 28 日
If you are using some block in the model and you are resolving the value in the block form the work-space, then variable must be present in the workspace.
Conditonal input branch execution is performed in optimization stage of the model compilation. Prior to it simulink evaluates the model's block parameter expressions to determine their values. So all the parameters used in the model should be present before compilation is started.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Event Functions についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!