필터 지우기
필터 지우기

Structure of Variables in Simevents

조회 수: 2 (최근 30일)
Lars Barnewold
Lars Barnewold 2016년 12월 9일
편집: Christoph Funda 2020년 12월 10일
With the realese of Matlab R2016b it is possible to access predefined variables in the workspace in Simulink or Simevents. This works pretty good for variables with a double structure or class. So I define a=1 in the workspace and my simulationblock in Simevents can use the variable a.
My question is: Can I access variables which are stored in datasets, cell arrays or tables directly as well?
I tried to access the variable by naming the dataset name (Mainvar.a). Unfortunately this does not work.
Thanks!
Lars

채택된 답변

Mo Zhao
Mo Zhao 2016년 12월 12일
Unfortunately, datasets, cell arrays and tables in workspace are not currently supported in SimEvents Event Actions. It is worth noting that this is also a limitation of MATLAB function block and MATLAB coder (while cell array as input/output is allowed for MATLAB coder). Thus, you might want to convert your data into the supported types, such as scalar, matrix, structure, etc.
  댓글 수: 2
Lars Barnewold
Lars Barnewold 2016년 12월 13일
Thanks Mo Zhao!
A normal structure works well and is enough for my purposes
Christoph Funda
Christoph Funda 2020년 12월 10일
편집: Christoph Funda 2020년 12월 10일
I actually have a problem even with a structure. I created a struct with 19 fields and I get an error, if i try to include it in simevents entity and server block. ROS(1).L2_3
if i type isstruct(ROS) or isstruct(ROS1) i get true, and but isvector(ROS(1).L2_3) is also true but i get the follwoing issue:
Data type of parameter 'ROS' is not supported in event actions. For more information about supported data types, see Supported data types in the documentation.
Yesterday it worked, and i can not remember, that i changed anything...

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by