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!