GUI gives error after moving to a different computer

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 matlab.graphics.internal.figfile.FigFile/read>@(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.
Thanks!

6 comentarios

Adam
Adam el 14 de En. de 2019
Does the different computer use the same version of Matlab?
Actually, no.
The GUI was written moslty on MAtlab 2017b, Which was currently updated to 2018b, without any problems occuring. The computer I moved the app to has matlab 2016b.
TADA
TADA el 14 de En. de 2019
This Function addToolbarExplorationButtons Was Introduced In 2018a.
I Guess Even If You Don't Actually Use It, Guide Must've Referenced It Once You Edited It In The New Version
Thanks.
I will try to see if I can update the version on the other computer.
Is there no other way to get around this?
TADA
TADA el 14 de En. de 2019
Editada: TADA el 14 de En. de 2019
Can You Still Access The Other Computer?
If So, Follow These Steps To Export All Of It To A Code File:
Now You Have Two Options
  1. Stick To The Code File And Give Up On Guide (My Suggestion)
  2. Take The Code And Generate A Guide Figure Back In Your Second Computer (the One With 2016) as Suggested Here
I Personally Have No Love For Layout Editors In General, But Of All The Ones I've Ever Used, Guide Is By Far The Worst And Your Problem Is A Good Example Of That. Code Is Text. It Should Not Be Hidden From The Developer In Binary Files.
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.

Iniciar sesión para comentar.

Respuestas (1)

TADA
TADA el 29 de Jul. de 2019
Editada: TADA el 29 de Jul. de 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;
cd(originalFunctionPath);
addToolbarExplorationButtons(varargin{:});
cd(currDir);
end
end
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
which('addToolbarExplorationButtons')
I also have doubts that this workaround would work with published compiled code...

1 comentario

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.

Iniciar sesión para comentar.

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Productos

Versión

R2016b

Etiquetas

Preguntada:

el 14 de En. de 2019

Comentada:

el 30 de Jul. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by