uiimport command--using variables

6 次查看(过去 30 天)
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.

回答(1 个)

Priyank Sharma
Priyank Sharma 2018-2-22
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.

类别

Help CenterFile Exchange 中查找有关 Files and Folders 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by