필터 지우기
필터 지우기

Using srcWorkspace with Data Dictionaries

조회 수: 5 (최근 30일)
Jared Augsburger
Jared Augsburger 2017년 11월 15일
답변: Tamas Rozsa 2022년 1월 7일
I'm attempting to upgrade an existing model to use Data Dictionaries. Currently, the code calling the model places external input data into a functions workspace and then executes a sim command using the parameter ('srcWorkspace','caller'). Once I attach to a data dictionary, it appears as though Simulink is ignoring the srcWorkspace setting and only using the base workspace to attempt to find variables.
Was wondering if anybody knows if this is intended behavior with Data dictionaries, or if there is a way to use Data dictionaries and define my input data inside a function. I'm using Matlab R2016b

답변 (1개)

Tamas Rozsa
Tamas Rozsa 2022년 1월 7일
I've experienced a very similar incorrect behavior with R2020a Update 7, too.
MathWorks confirmed that this is a bug. 'SrcWorkspace' should work properly with data dictionaries as well.
Another way and a possible workaround to feed the model with temporary data is utilizing Simulink.SimulationInput class (permanent data shall be stored in data dictionaries). Details for R2020a can be found here: https://www.mathworks.com/help/releases/R2020a/simulink/slref/simulink.simulationinput-class.html
According to the tech support, "this workflow is the recommended workflow to apply variable overrides, as the SimulationInput object provides better containerization, traceability, and reuse across workflows".
Unfortunately, this has been introduced only in R2017b, i.e. it was not yet available in R2016b.

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by