Matlab2018b on Linux / figure vs uifigure

3 views (last 30 days)
Robert Schäfer
Robert Schäfer on 22 Jun 2020
Answered: Robert Schäfer on 24 Jul 2020
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 Comment
Robert Schäfer
Robert Schäfer on 25 Jun 2020
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?

Sign in to comment.

Answers (2)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi on 24 Jul 2020
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 on 24 Jul 2020
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" ...

Categories

Find more on Develop uifigure-Based Apps in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!