Guest User

Untitled

a guest
Jun 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function hidematlab()
  2. %HIDEMATLAB Hide the main Matlab desktop window (HACK)
  3.  
  4. dtWin = desktopwindow();
  5. if ~isempty(dtWin)
  6. dtWin.setVisible(0);
  7. end
  8.  
  9. function out = desktopwindow()
  10. %DESKTOPWINDOW Find the main Matlab desktop window (HACK)
  11.  
  12. wins = java.awt.Window.getOwnerlessWindows();
  13. out = [];
  14. for i = 1:numel(wins)
  15. if isa(wins(i), 'com.mathworks.mde.desk.MLMainFrame')
  16. out = wins(i);
  17. return;
  18. end
  19. end
  20.  
  21. matlab -nojvm -nosplash -nodesktop -wait -r script_name
Add Comment
Please, Sign In to add comment