Matlab2018b on Linux / figure vs uifigure

조회 수: 1 (최근 30일)
Robert Schäfer
Robert Schäfer 2020년 6월 22일
답변: Robert Schäfer 2020년 7월 24일
Hi,
I created a data plotting class/app (based on uifigure and other ui components, not via the app designer) on a Win10 machine (ML2019b). Now when trying to run this on linux, the uifigure won't open (a regular figure() opens however).
Output:
>>fig2 = uifigure('Name','test2')
fig2 =
Figure (test2) with properties:
Number: []
Name: 'test2'
Color: [0.9400 0.9400 0.9400]
Position: [1000 918 560 420]
Units: 'pixels'
Show all properties
User abort via ctrl+C
General Error occurred
Unable to display properties for variable fig2 because it refers to a deleted object.
Can anyone help me?
Cheers,
Robert
  댓글 수: 1
Robert Schäfer
Robert Schäfer 2020년 6월 25일
I narrowed it down to:
In uifigure.m:
% Call the uifigureImpl function to create the uifigure
window = matlab.ui.internal.uifigureImpl(varargin{:});
Where again in uifigureImpl.m:
% internal implementation of uifigure creation
% Copyright 2017 The MathWorks, Inc.
nargoutchk(0,1);
controllerInfo.ControllerClassName = 'matlab.ui.internal.controller.FigureController';
% Create the uifigure, configured for app building
% Set defaults for unsupported properties first.
% After setting ControllerInfo, unsupported property sets will error.
window = appwindowfactory('WindowStyle','normal',...
'DockControls','off',...
'HandleVisibility','off',...
'IntegerHandle','off',...
'MenuBar','none',...
'NumberTitle','off',...
'Toolbar','none',...
'ControllerInfo',controllerInfo,...
'AutoResizeChildren', 'on',...
varargin{:});
% configure the new figure for application building
matlab.ui.internal.FigureServices.configureFigureForAppBuilding(window);
if (nargout > 0)
varargout{1} = window;
end
The line that causes this "stuck" issue is the controller info. Someone who could explain?

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

답변 (2개)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2020년 7월 24일
Hi,
Figures created using 'uifigure' can be opened without any issue irrespective of the platform. You might be trying to view the figure after you have actually closed it once using the close button on the top right corner of the figure. Even the error message shows that you are trying to refer to a deleted object. Try to ensure that the handle is not deleted before you open it.

Robert Schäfer
Robert Schäfer 2020년 7월 24일
Thanks for the answer. The uifigure doesn't even open.
Well I guess it's another problem then, maybe because of doing "my Windows machine -> remote desktop to a Linux machine -> SSH to another Linux machine -> starting Matlab" ...

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by