uiimport command--using variables

2 views (last 30 days)
Dylan Mecca
Dylan Mecca on 9 Feb 2018
Answered: Priyank Sharma on 22 Feb 2018
Does anybody know how to be able to pause code or have a sort of 'preemptive' way to call out variables when using uiimport to import data? More specifically, the code is running before the user can select the data wanted to use in the script. Once the code has finished, the user is able to see the variables when called out in the command window. I need the code to allow me to finish the import before running.

Answers (1)

Priyank Sharma
Priyank Sharma on 22 Feb 2018
You can always stall the execution of the code followed by the uiimport command by storing the output as fields in a structure as follows:
S = uiimport(__);
On a note, there is an additional bug in uiimport that affects the return value method. However, this bug has been fixed for Release 14 (R14).
For previous releases, you can look for the following workaround:
1) Delete $MATLAB/toolbox/matlab/uitools/uiimport.p, where $MATLAB is your MATLAB root directory.
2) Edit the $MATLAB/toolbox/matlab/uitools/uiimport.m file.
3) Change line 493 of the uiimport.m file from
out.(vname) = ad.datastruct(names{i});
to
out.(vname) = ad.datastruct.(names{i});
by adding a period between "datastruct" and "(names{i})";
4) Exit and restart MATLAB.
Hope this helps.

Community Treasure Hunt

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

Start Hunting!