How to get var from base workspace in test sequence
Show older comments
How to get var from base workspace in test sequence
6 Comments
Rik
on 20 Aug 2024
I would never advise the use of evalin, especially not in a tester.
What are you actually trying to achieve? The answer below answers your question, but I expect you should be asking a different question.
(also, if the answer solves your question, you should click the 'accept answer' button)
浩 程
on 20 Aug 2024
浩 程
on 20 Aug 2024
浩 程
on 20 Aug 2024
"I want to use code to iterate a variable in a test sequence, which requires getting the change value from the workspace."
Pass it as an argument.
The approach you are attempting has a very strong smell to it: https://en.wikipedia.org/wiki/Code_smell
Rik
on 20 Aug 2024
Why don't you supply the list of test variables in a cell array?
Making your test cases static helps keeping your tests stable. Without a consistent test, it is not possible to have a good regression test.
Accepted Answer
More Answers (0)
Categories
Find more on Inputs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!