Why does my MATLAB code not wait for UIIMPORT to complete?

18 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 1 Dez. 2020
Bearbeitet: MathWorks Support Team am 1 Dez. 2020
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 Kommentar
Walter Roberson
Walter Roberson am 11 Dez. 2015
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;

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu C Shared Library Integration finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by