Two solutions can help you. This is actually a bit complicated. Solution 1 uses the control window using the mex program method using c code. Solution 2 is also getting complicated, just use the MATLAB parallel toolbar. Hmm, I suggest your solution for using 1.
solution 1:
Create a cpp file that controls your interactive program (e.g. window explorer here). code below. copy and save the code as "ctrlWindow.cpp" in your current MATLAB folder.
compile ctrlWindow.cpp with the lcc compiler:
mex -setup % choose compiler: type this command at MATLAB command, then choose lcc complier on windows 32 system mex ctrlWindow.cpp % compile cpp: you would find ctrlWindow.mexw32 at current folder
run the mex file as an m file in the MATLAB command:
ctrlWindow ('your_program_window_name', command);
i.e. the window name of the folder "myfold" is myfold, which is displayed in the upper left corner of the window, enter the command:
ctrlWindow('myfold',6);
this minimizes the window of your folder. I suggest you first minimize the program window, and then maximize it, and the participants will again focus on your program:
ctrlWindow('myfold',6);%minimize window ctrlWindow('myfold',3);%maximize window and participants would focus on this window
:
HIDE 0 SHOWNORMAL 1 NORMAL 1 SHOWMINIMIZED 2 SHOWMAXIMIZED 3 MAXIMIZE 3 SHOWNOACTIVATE 4 SHOW 5 MINIMIZE 6 SHOWMINNOACTIVE 7 SHOWNA 8 RESTORE 9 SHOWDEFAULT 10 FORCEMINIMIZE 11 MAX 11
// File name: ctrlWindow.cpp
#include <windows.h> #include "mex.h" void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { mxChar* winName; //name of window wanted to be found HWND hwnd; //handle of window int command; //command of control window // check number of input if(nrhs!=2) mexErrMsgTxt("input must be 2"); // check class of input if (mxIsChar(prhs[0])) winName=mxGetChars(prhs[0]);//get name of window else mexErrMsgTxt("input 1 should be char -- name of window"); if (mxIsDouble(prhs[1])) { command = (int) mxGetScalar(prhs[1]);//get command if(command<0 || command >11)//check command mexErrMsgTxt("No such command!!!"); } else mexErrMsgTxt("input 2 should be a double"); // find window hwnd = FindWindowW(NULL, (LPCWSTR)winName); if(NULL==hwnd) { MessageBoxW(NULL,(LPCWSTR) L"Can't find the window!!!",NULL,MB_OK); return; } ShowWindow(hwnd, command);//control the window }
Solution 2:
matlabpool open 2
open two matlab backgrounds, first use your first first program, use the second, control the second program.
source share