Error while evaluating uicontrol Callback

I am encountering a weird problem.
I use my personal computer to run matlab on a remote linux server (connection via ssh). Inside Matlab I run a toolbox that opens a GUI. When I use my laptop to run the Matlab Toolbox, it works perfectly.
However, when a colleague of mine uses her windows machine to do the same i.e. connect to the server and run matlab and the toolbox, she gets a weird error saying "Error while evaluating uicontrol Callback". I am attaching a screenshot.
The matlab installation on the server is perfect as it works perfectly in my case.
What causes this matlab error? It occurs when I click on a specific button of the toolbox's GUI that is supposed to open a window to select a file.
This button calles the function as shown here: https://c4science.ch/source/CAP_Toolbox/browse/master/CAP_TB.m$1261 and never opens the GUI for file selection. Instead it throws the error.
To give more info, when I use my laptop and it works fine, I get a window as shown in the attached file named "window.png"

9 commentaires

Jan
Jan le 23 Fév 2022
Please post the error message as text, not as screenshot. The message is clear: The 25th character of the mentioned line is not recognized. I assume, it is not a quote (char(39)), but an accent ´ or ` .
But actually uigetfile should be a part of Matlab's toolbox and the command usejava also, so invalid characters are not expected. Do you use an own implementation of uigetfile?
Makis
Makis le 23 Fév 2022
Modifié(e) : Makis le 23 Fév 2022
Hi. Thank you for the answer. I will post the error shortly. I launch a matlab toolbox that opens a GUI and then at the moment I click on a GUI's button (that is supposed to open a window to select a file), this error occurs. As I said, this does not happen when I use my personal laptop but only when my colleague tries. And this makes it very weird and impossible to debug.
The GUI button that throws the error is here named "SeedButton_Callback": https://c4science.ch/source/CAP_Toolbox/browse/master/CAP_TB.m%241261. This is an open source matlab toolbox.
To give more info, when I use my laptop and it works fine, I get a window as shown in the attached file named "window.png"
The toolbox containing CAP_TB is not the problem, but the called uigetfile command. Either the colleague has modified this function or inserted a user-defined folder in front of the path, which contains an invalid usejava function. The error message is clear: it is the 25th character of the shown line in usejava, so it does not depend on the used toolbox, but on the Matlab installation.
If the colleague to run uigetfile directly, the same error should occur.
I wouldn't use the shown toolbox for productive work:
addpath(genpath('./Plotting'));
addpath(genpath('./Analysis'));
addpath(genpath('./DefaultData'));
% Sets warnings off
warning('off');
Brrrr. Adding folders relying on the current folder is a bad programming practice. Disabling all warnings is evil. The excessive usage of clear is not Matlab'ish, but a waste of time.
Makis
Makis le 23 Fév 2022
I will investigate all these and come back with news. Thank you for the help.
Makis
Makis le 23 Fév 2022
Modifié(e) : Makis le 23 Fév 2022
I got an update from my colleague. On the same server and using the same matlab version, `uigetdir` thorws an error (attached here, sorry for the screenshot -- it was forwared to me) but not in my case. I think I need to contact the server administrator.
This seems to be the same error. Again: If you post it as text instead of a screen shot, we could check the ASCII code of the 25th character. Unfortunately seeing only the screen shot is just 1mm away from the solution and we can almost help you.
Maybe this is not the original system_dependent.m file? See:
which system_dependent -all
Makis
Makis le 23 Fév 2022
Hi. This command returns `built-in (undocumented)`. Do you want me to copy the error and just post it as text?
Sorry, I was confused. The failing function is usejava. So the output of
which usejava -all
matters and the double value of 25th character of line 44:
S = fileread('usejava.m');
C = split(S, char(10));
C{44}
double(C{44}(25))
Makis
Makis le 23 Fév 2022
Modifié(e) : Makis le 23 Fév 2022
From my end (I do not get the java error when I launch the toolbox GUI) I have:
>> which usejava -all
/opt/Licensed_Soft/Matlab/R2019a/toolbox/matlab/general/usejava.m
>> S = fileread('usejava.m');
>> C = split(S, char(10));
>> C{44}
ans =
'isok = system_dependent('useJava',feature);'
>> double(C{44}(25))
ans =
39
I will ask my colleague to do the same (becasue the error persists when she clicks on the specific GUI button) however, in all cases, we connect to the same server and use the same matlab...

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Produits

Version

R2019a

Question posée :

le 22 Fév 2022

Modifié(e) :

le 23 Fév 2022

Community Treasure Hunt

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

Start Hunting!

Translated by