How does seperate script tell compiled GUI its done
Mostra commenti meno recenti
I have a simple Gui I built in App Designer that allows the user to select a file and fill in some text boxes. These box vaules are saved as variables in a mat file which is saved. The run button in the app calls a external script which loads these values into its workspace. The script then processes the file and can save out between 1 a 16 files. I have not been able to find a way to pass the status of the script back to the app as it saves each of the files. Closest I have came is using a msgbox which pops up a window between each file save. This does not work becasue it happens after the fact and either stays open and the next one stacks on top or I use pause and hold it open for x time then close which slows the process. And at the end I would like it to say done but am unsure how to do that either.
%% Point cloud export
% In this part of the code, the scatterplot is exported.
% Defining output document names
filename = sprintf([output_file_name,'_', num2str(iiii)]);
cd(output)
% Write file
pcloud{1,ii} = PC_Final1;
pcwrite(PC_Final1,filename,'PLYFormat','binary');
cd(input)
ref = []; % suppression of the loaded point cloud
f = msgbox((["Processed File:";output_file_name,'_', num2str(iiii) ' of 16\n']),"Status");
pause(10)
if isvalid(f); delete(f); end
How can I have the msgbox close when the next file is saved and after the last one say done?
6 Commenti
Walter Roberson
il 28 Mag 2022
How are you invoking the external program? When you invoke it are you waiting for it to finish each time, or are you invoking asynchronously and somehow detecting completion?
Donny Mott
il 28 Mag 2022
Walter Roberson
il 28 Mag 2022
Is an external program being invoked such as using system()?
Donny Mott
il 28 Mag 2022
Walter Roberson
il 29 Mag 2022
Unless you are using GPUs or parallel processing, or external processes, then the script does not return to the gui until the script finishes executing. As soon as you get back from the run() the script is finished.
Donny Mott
il 29 Mag 2022
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Variables in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!