Version mismatch with exportgraphics? "class matlab.gra​phics.inte​rnal.mlpri​ntjob has no Constant property or Static method named 'containsUIElements'"

11 views (last 30 days)
When running
fig = figure;
% plotting commands..
exportgraphics(fig, 'd:\plot.emf');
I get the error
Error using exportgraphics
The class 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
C:\Program Files\MATLAB\R2022a\toolbox\matlab\graphics\printing\exportgraphics.p
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?
  1 Comment
z8080 on 16 May 2022
It is very disappointing to see these forums reduced to such low traffic, and so little usability. If it's come so that any question takes weeks to get an answer, presumably because all the kind souls who used to help on here, have now migrated from Matlab to Python/JS/R, then perhaps that's what disappointed Matlab users are best advised to do as well.

Sign in to comment.

Answers (0)




Community Treasure Hunt

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

Start Hunting!