Differentiate different matlab instances opened in GUI
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Steven Lord
2022-4-1
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.
采纳的回答
Jan
2022-4-1
编辑:Jan
2022-4-1
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 个评论
Jan
2022-4-2
@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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!