Run exe file with two files

2 views (last 30 days)
I want to run exe file using matlab, it requires two files that i choose
i used system function, but it takes long time and i don't have any results or error message
whats problem?
my code is
function choose_tissue_file_Callback(hObject, eventdata, handles)
[tissuefilename pathname] = uigetfile({'*.mci'},'File Selector')
handles.tissue_file_name=tissuefilename
guidata(hObject, handles);
function choose_illcol_setup_Callback(hObject, eventdata, handles)
[illcolsetupfilename pathname] = uigetfile({'*.txt'},'File Selector')
handles.illcolsetup_file_name=illcolsetupfilename
guidata(hObject, handles);
function simulink_Callback(hObject, eventdata, handles)
illcolsetup=handles.illcolsetup_file_name
tissue=handles.tissue_file_name
system ('"mcml.exe" tissue illcolsetup')

Accepted Answer

Walter Roberson
Walter Roberson on 28 Dec 2021
Edited: Walter Roberson on 28 Dec 2021
function choose_tissue_file_Callback(hObject, eventdata, handles)
[tissuefilename pathname] = uigetfile({'*.mci'},'File Selector')
handles.tissue_file_name = fullfile(pathname, tissuefilename);
guidata(hObject, handles);
function choose_illcol_setup_Callback(hObject, eventdata, handles)
[illcolsetupfilename pathname] = uigetfile({'*.txt'},'File Selector')
handles.illcolsetup_file_name = fullfile(pathname, illcolsetupfilename);
guidata(hObject, handles);
function simulink_Callback(hObject, eventdata, handles)
illcolsetup = handles.illcolsetup_file_name
tissue = handles.tissue_file_name
cmd = sprintf('"mcml.exe" "%s" "%s"', tissue, illcolsetup);
system(cmd)
You might also be interested in using .NET System.Diagnostics.Process which can be used to monitor a process while it is running.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!