GUI gives error after moving to a different computer

4 views (last 30 days)
I have written a GUI using GUIDE in order to view and analyse 3d quiver plots.
Once I moved it to a different computer (both .fig and .m files), it gives the error:
Undefined function or variable 'addToolbarExplorationButtons'.
Error in>@(fig,~)addToolbarExplorationButtons(fig)
I also can no longer edit it using guide.
other than that, the gui actually works fine if I ignore the error, but I would like to modify it on this computer.
Bruno Luong
Bruno Luong on 29 Jul 2019
Have the same problem of "Undefined function or variable 'addToolbarExplorationButtons'." when GUI is developped under 2019a and use it with 2016b.
The Export/Import game indicated by TADA has really no use, since it breaks too many things.

Sign in to comment.

Answers (1)

TADA on 29 Jul 2019
Edited: TADA on 29 Jul 2019
Another possible workaround would be to create a stub of this function
Unfortunately this function is not a builtin, so builtin can't be used to call the original
still here's a solution that should enable keeping the functionality in later versions and the stub in earlier versions is this:
This is a very dirty workaround, but it works for me with R2018b, I don't have an earlier version to test when the file is missing, but I think it should work
Anyway, creatae an .m file function for the misbehaving addToolbarExplorationButtons (probably need to do the same thing with removeToolbarExplorationButtons as well
function addToolbarExplorationButtons(varargin)
originalFunctionPath = fullfile(matlabroot, 'toolbox', 'matlab', 'plottools');
if exist(fullfile(originalFunctionPath, 'addToolbarExplorationButtons.p'), 'file')
currDir = pwd;
Hopefully there aren't too many other function calls that GUIDE sneaks in
I'm also not sure that these function are located in the same folders for all versions of matlab, so it may be necessary to check where they are located with your version using
I also have doubts that this workaround would work with published compiled code...
  1 Comment
Bruno Luong
Bruno Luong on 30 Jul 2019
I like the idea eben if it's "dirty".
I my case it requires I put the addToolbarExplorationButtons function on the PC with old MATLAB. That's OK. I don't want to mess with addToolbarExplorationButtons on the new release.
This is another nasty effect of the new Toolbar which break the compatibility of GUI accross the versions (even they all use HG2).
I actually ended of redesign my GUI with old MATLAB, it takes me one day of work.

Sign in to comment.





Community Treasure Hunt

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

Start Hunting!

Translated by