how to use uiimport in standalone application

8 次查看(过去 30 天)
i am developing an application and i am using uiimport in my GUI
however, when i complie the application using matlab standalone app complier and run the standalone application, uiimport function doesnot work
kindly help and i cannot provide u with code and i am reading csv file using uiimport in my GUI and everytime i have to perform certain tests the csv length (i.e variables) will change
please dont ask for code
regards
  3 个评论
Hans F Hansen
Hans F Hansen 2023-8-28
I'm having the same problem
I use a function in my code to launch the Import Tool
_____
function [data,varname] = UseImportToolFun
% Open a file in MATLAB Import Tool and return the loaded variable
vars1 = whos;
uiimport('-file')
fprintf('Waiting for importedData...')
while length(who)==1
pause(1)
end
fprintf('\n')
newvars = whos;
% make a copy of the newly added variable named data
varname = newvars(1).name;
eval(sprintf('data=%s;',varname));
end
_____
It all works well when I run it in the matlab environment, but when I compile my application to a stand-alone application with the matlab compiler, it crashes on the uimport('-file') line. Is there a solution to this problem so that I can still use the interactive import tool?
Thanks,
Hans
Walter Roberson
Walter Roberson 2023-8-28
No, uiimport() allows the user to choose the output representation and allows the user to generate code. The compilation process needs to be more specific about the output representation, and compiled executables do not support code generation.
Compiled executables also do not support eval() . Or whos for that matter.
You are going to need to rewrite the code entirely.

请先登录,再进行评论。

回答(1 个)

AMINE EL MOUATAMID
AMINE EL MOUATAMID 2019-9-26
try to use this script maybe it will help you
https://www.mathworks.com/matlabcentral/fileexchange/72492-clipboard2workspace

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by