Differentiate different matlab instances opened in GUI
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
When we open the matlab through startup.m we add in matlabpath different paths of different libraries.
So for e.g. if user selects x, then we link the libraries of project x in matlab path.
if user selects y, then we link the libraries of project y in matlab path.
Now if a person is working on multiple activities and on multiple projects, he/she may forget with which environment the current MATLAB is opened. So, I was looking for is there any way that we can append some string to the MATLAB GUI to easily check with which environment current matlab is open ?
Note : I cannot add both set of libraries at the same time, as the name of some library files are same which will create conflict. I know in the command window we can display something but if there are lot of commands entered after opening matlab then the data would be lost.
2 Kommentare
Steven Lord
am 1 Apr. 2022
Are you aware of the MATLAB Projects functionality? This may help you organize the files and handle automatically updating the path to reflect what files need to be accessible for each project. It doesn't directly address your question of annotating the Desktop somehow to indicate which project is open but it still might be useful to you in other ways.
Akzeptierte Antwort
Jan
am 1 Apr. 2022
Bearbeitet: Jan
am 1 Apr. 2022
If you want to set the title of Matlab's command windows from inside the startup function, you haveto use a timer:
start(timer('TimerFcn', @SetCWTitle, 'ExecutionMode', 'SingleShot', ...
'StartDelay', 5));
function SetCWTitle(ObjH, EventData) %#ok<INUSD>
CmdWinTool('Title', 'Matlab Instance XY');
stop(ObjH);
delete(ObjH);
end
You can use this tool to change the background of Matlab's command window also, which might be more prominent for the user than the title.
2 Kommentare
Jan
am 2 Apr. 2022
@vivek patel: Yes. Simply try it: Setting the title during the startup.m function is running, works for about 1 second, than it is rest automatically. I assume, the title i set in matlabc.m also or in another routine at starting up.
An option is to do this manually:
function mySetup(V)
switch V
case 1
path('MyListOfFolders/taken/from/anywhere/V1');
CmdWinTool('Title', 'Matlab V1');
CmdWinTool('background', [0.5, 0.5, 1]);
case 2
path('MyListOfFolders/taken/from/anywhere/V2');
CmdWinTool('Title', 'Matlab V2');
CmdWinTool('background', [0.5, 1, 0.5]);
end
Of course, the list of folders must be defined in a usefull way.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!