필터 지우기
필터 지우기

compiling GUI with folder of input text files

조회 수: 1 (최근 30일)
hana
hana 2011년 8월 24일
I've compiled a Gui that has a folder containing input txt files. I did include that folder unmder "other files" when I made the package, but for some reason, I can't reach it in the compiled version. all suggestions/ ideas are welcome

답변 (2개)

Friedrich
Friedrich 2011년 8월 25일
Hi,
the path management in deployed applications is different than in MATLAB. I would recommend reading this:

hana
hana 2011년 9월 20일
I did read this article & can see that path management is different in compiled files; however I’m not sure how to fix my problem yet. Here is some more detail: I’ve compiled this fairly complex Gui that is using txt formatted input files to operate and saves other txt files in different stage of processing in different folders. I’ve included all subfolders in the main folder that I have all the other Gui functions. I’ve compiled the main Gui with the rest of functions/subfolders as it’s “other files”. Now my compiled Gui is not operating properly once I want to choose an input file. It doesn’t even open the uigetfile dialog!! . This is a sample of what I’m using to open a file in the original Gui:
[stat, mess]= fileattrib ('PF_open'); %[PF_open is the subfolder containing input txt files
folddir = mess.Name;
[filename, pathname] = uigetfile('*.txt', 'Pick a PF.file', folddir);
if isequal(filename,0)
disp('User selected Cancel')
else
disp(['User selected', fullfile(pathname, filename)])
cd(folddir);
fid = fopen(filename,'rt');
[ AA,DOFMC1b,DOFMC2b,DOFSC1b,DOFSC2b,DOFSC3b,DOFSC4b ]=...
textread(filename,'%s%f%f%f%f%f%f');
[ AAFP,DOFMC1bFP,DOFMC2bFP,DOFSC1bFP,DOFSC2bFP,DOFSC3bFP,DOFSC4bFP ]=...
textread(filename,'%s%f%f%f%f%f%f');
cd(handles.currentfold);
handles.AA=AA;
handles.DOFMC1b=DOFMC1b;
.
.
.
As you see I’m using “cd”,” fileattrib” to switch btw folders/directories. I have even tried with a far simpler Gui and added the path to sub-folders to the main mother directory & then compiling it. But that didn’t work either. I’d appreciate any help.

카테고리

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