When using the system to run the executable, how to close some intermediate result windows? The executable needs several inputs. After each input, there will be a window.

Hi,
I want to use matlab to access an executable (created by C). For that executable, it needs several inputs. After each input, there will be a figure window popping out (some result). Is there any way to close those figure windows in script? In the end, I want to put a code to run that executable rather than do it manually.
Appreciated,
Corey

댓글 수: 2

I'm assuming these windows are generated by the external executable and not by MATLAB.
Depends what your environment is. In linux, if you can identify the window with wmctrl, you should be able to close it.
I'm pretty sure it's going to boil down to an external solution either way.
In MacOS you would probably end up using AppleScript, or the newer Shortcuts.

댓글을 달려면 로그인하십시오.

답변 (1개)

Hornett
Hornett 2024년 1월 24일
편집: Walter Roberson 2024년 1월 24일
Hi,
I understand that you want to close multiple figure windows open in MATLAB and would like to close them all at once, you may use the command close all. This will conveniently close all open figure windows. Alternatively, if you prefer to close a specific window, you can pass its handle to the close function. For a more comprehensive understanding and additional options, please feel free to consult the MATLAB documentation on figure handling : https://www.mathworks.com/help/matlab/ref/close.html
I hope this helps!

댓글 수: 1

Unfortunately it is not clear where the figure windows are being generated:
  • traditional figure windows
  • ui figure windows (app designer)
  • generated by an external application
My reading of the question suggests that they are being generated by an external application.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2022년 3월 7일

댓글:

2024년 1월 24일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by