When do assignin variables become active?
古いコメントを表示
I have a function which contains the following two lines:
import_file(filename); [a b] = filt(f2,f1,Avg);
The import_file is another function which opens up a file and uses the assignin cmd to set variables into the 'base' MathLab workspace. One of these variables is Avg. If I simply manually enter "import_file(filename)" on the CLI line, things work as expected and Avg shows up as an array. However if I run these two lines inside a function, the second command complains that Avg is an Undefined function or variable 'Avg'. It acts like it is hurrying on before Avg actually does get set into the base workspace.
I tried using the waitfor(Avg) command, but that doesn't seem to wait for Avg to appear in the base workspace and then continue.
How do I fix this?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Performance and Memory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!