Version mismatch with exportgraphics? "class matlab.graphics.internal.mlprintjob has no Constant property or Static method named 'containsUIElements'"
11 views (last 30 days)
fig = figure;
% plotting commands..
I get the error
Error using exportgraphics
The class matlab.graphics.internal.mlprintjob has no Constant property or Static method named 'containsUIElements'.
I used the same exportgraphics command above for a long time, without problems. What recently happened is that I copied the exportgraphics.m file from c:\Program Files\MATLAB\R2022a\toolbox\matlab\graphics\printing\en\ to c:\Program Files\MATLAB\R2019b\toolbox\matlab\graphics\printing\, in the hopes of being able to use it in Matlab 2019b too. That didn;t work, and when I exited Matlab 2019b and deleted the .m file from its folder, then entered Matlab 2022a, the above error happens.
There's probably been a confusion of file versions, although there seems to now only ever be the 2022a version left:
>> which -all exportgraphics
Running restoredefaultpath and savepath doesn't help. I also renamed either the m or the p file to something else, one at a time, to prevent confusion between the two - this too didn't help. What else can I try?
A second question would be: *is there* a way to make `exportgraphics` work in Matlab 2019b, if (clearly) the method of just copying the file over from v2022a does not work?