Why does “setVariable” in Simulink Test not update variables?
I’m using “setVariable” to update a variable in a test harness. I’m using the command
evalin('base', 'y_coordinate')
in a “From Workspace” block to load the variable into Simulink.
However, in R2019b the variable doesn’t seem to get updated. Why does this happen?
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
In R2019b, the behavior of “setVariable” is modified such that it overrides only model variables (as opposed to MATLAB variables).
I attached a simpler model (“SimpleVars_R2019b.slx”) to help illustrate this. This model has two “From Workspace” blocks, one set to “a” and one set to “evalin(‘base’, ‘b’)”.
If you call “findVars” on this model, only “a” is considered to be a model variable, even though both output their timeseries when run:
>> vars = Simulink.findVars('SimpleVars_R2019b')vars = VariableUsage with properties: Name: 'a'
Source: 'base workspace'
SourceType: 'base workspace'
Users: {'SimpleVars_R2019b/From
Workspace'}
The R2019b behavior
SEE COMPLETE ANSWER CLICK THE LINK