필터 지우기
필터 지우기

how run two codes at the same time from GUI?

조회 수: 4 (최근 30일)
nada ali
nada ali 2014년 2월 18일
댓글: nada ali 2014년 2월 19일
*Hi,
How I can open two copies of matlab in my computer automatically.
In fact, I have two codes I would to run it at the same time. What I need is running the two codes in parallel from GUI automatically.
I need when press the a button, the two codes are running at the same time together.
Thanks*

답변 (1개)

Iain
Iain 2014년 2월 18일
The best you can probably sensibly do is just use parallel computing.
Something like
parfor i = 1:2
if i == 1
result(i) = runcode1(input(1))
else
result(i) = runcode2(input(2))
end
end
  댓글 수: 2
nada ali
nada ali 2014년 2월 18일
thanks I think this code do not run the two functions at the same time. Right?
I think , two workers have to work together , hence two windows have to be opened. please, I need more help Anyway, I try my two functions:
parfor i = 1:2
if i == 1
result(i) = seq_alignment();
else
result(i) = seq_alignment_c();
end
end
this is what I got %%%%%% In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in ==> phd>(parfor body) at 98 result(i) = seq_alignment_c();
Error in ==> parallel_function at 475 consume(base, limit, F(base, limit));
Error in ==> phd>pushbutton11_Callback at 92 parfor i = 1:2
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> phd at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)phd('pushbutton11_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
nada ali
nada ali 2014년 2월 19일
Thank u so much it is working now and the time is less I just add matlabpool open local 2
I just want to ask if I can show the processing in two windows(2 workers) because I show it in one window.
thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Parallel Computing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by