How to get var from base workspace in test sequence
Ältere Kommentare anzeigen
How to get var from base workspace in test sequence
6 Kommentare
Rik
am 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)
浩 程
am 20 Aug. 2024
浩 程
am 20 Aug. 2024
浩 程
am 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
am 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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Inputs finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
