필터 지우기
필터 지우기

how to use uiimport in standalone application

조회 수: 12 (최근 30일)
asad ali
asad ali 2019년 8월 28일
댓글: Walter Roberson 2023년 8월 28일
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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by