Borrar filtros
Borrar filtros

how run two codes at the same time from GUI?

4 visualizaciones (últimos 30 días)
nada ali
nada ali el 18 de Feb. de 2014
Comentada: nada ali el 19 de Feb. de 2014
*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*

Respuestas (1)

Iain
Iain el 18 de Feb. de 2014
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 comentarios
nada ali
nada ali el 18 de Feb. de 2014
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 el 19 de Feb. de 2014
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

Iniciar sesión para comentar.

Categorías

Más información sobre Parallel Computing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by