Why does my MATLAB code not wait for UIIMPORT to complete?
13 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2012-7-23
编辑: MathWorks Support Team
2020-12-1
I am using UIIMPORT. My code continues to execute before I have completed using the UIIMPORT wizard. However, I need to have the UIIMPORT variables available before the code continues.
采纳的回答
MathWorks Support Team
2020-12-1
编辑:MathWorks Support Team
2020-12-1
To block code execution until the user has finished using the Import Wizard, request a return value from UIIMPORT. For example:
S=uiimport;
However, note that there is an additional bug in UIIMPORT that affects the return value method. This can be resolved using the following Related Answer:
1 个评论
Walter Roberson
2015-12-11
Shawn,
The situation is like using load(): if you load() without assigning the value to anything then individual variables are created in your workspace, but if you assign load() to a variable then the result is a struct array that has one field for each variable that was loaded. In your situation you could use
drs_struct = uiimport('-file');
data = drs_struct.data;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!