MATLAB: Can I not close an xPC Host Scope Viewer Figure saved as .fig file when opened later with xPC Target 4.2 (R2009b)

Simulink Real-Time

If I save a xPC Target Host Scope Viewer to the default MATLAB Figure format .fig and reopen it at a later instant, the figure have some defects and does not behave like a normal MATLAB figure.
One example is that you can not close the figure without using 'close all force'.

Best Answer

The ability to use the figures saved from xPC Host Scope Viewer block as a normal figure at a later time is not available in xPC Target 4.2 (R2009b). The xPC Host Scope Figure is tightly connected to the xPC Simulation and some parts are implemented in the Figure itself. When saved and opened at another time, this interaction does not work and errors or does not work as intended.
To workaround this issue, please download the attached MATLAB function named 'closeScope' and execute this function to close the figure.