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?


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

The R2019b behavior





Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Technical Source

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.