MATLAB Technical Support also said there is no way to solve this issue even in MATLAB 2021b update 3.
Because my customer requested these panels to be centered on several occasions, I figured out a work around that appears to work.
I wrote a little function that I call that creates a figure on top of all of my larger figures/plots just before I call the the MATLAB "uigetfile" or "uiputfile" functions:
% this is the function I call from my application code....
function [fig] = makeFileFig()
% Need a little figure to fix it so the uigetfile/uiputfile
% panels appears in the center of the monitor's screen rather than
% always appearing in the upper left hand corner where they always appear.
% My work-around seems to work. But I need to continue testing
% It worked in several places but I want to continue implementing it
% and testing it.
fig=figure();
fig.NumberTitle = 'off';
fig.Name = '';
fig.Units = 'normalized';
fig.Visible = 'on';
fig.WindowStyle = 'modal';
fig.Position =[0.3 0.3 0.473 .5];
fig.Color = 'w';
% The CenterFigure function call I have here uses groot to get the screen size and then I center the figure.
CenterFigure(fig);
end
% inside my application code I have the following call to the above function:
fig = makeFileFig();
% I then use any normal call to uigetfile or uiputfile..... which is NOW Centered on my Monitor Screen....
[ filename pathname] = uigetfile(........see MATLAB docs for property pairs ...);
% At this point I have the file name and pathname from the uigetfile call...
% next, I delete the figure
delete(fig);
This seems to work fine so far, because the “uigetfile” fuction always sticks its panel in the upper left corner of its figure. Because the little figure window, ( just a touch bigger than the uigetfile panel is centered), uigetfile panel looks centered.
So far it has worked in several places but I’ll know for sure when I embed it into all of my code. My app is quite large and I use “uigetfile” and “uiputfile” hundreds of times so it will take a while to update my system with the changes, I plan on making this change a little at a time as I add other functionality.
Bob
It works for me and that is all I care about. See attached figure.