undefined function or variable in my GUIDE gui code!

when I run the code, I get the following error. I have attached the m file and the fig file as well. I did not write these codes but I need to debug it. Do you have any ideas what goes wrong?
Undefined function or variable 'Angle_B2_CreateFcn'.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in pic_display (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)pic_display('Angle_B2_CreateFcn',hObject,eventdata,guidata(hObject))
Error using Meary's Angle
Error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters,
or other syntax error. To construct matrices, use brackets instead of parentheses.
Undefined function or variable 'Angle_B2_DeleteFcn'.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in pic_display (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)pic_display('Angle_B2_DeleteFcn',hObject,eventdata,guidata(hObject))
Error using closereq (line 18)
Error while evaluating UIControl DeleteFcn.

回答 (1 件)

Image Analyst
Image Analyst 2020 年 5 月 11 日

0 投票

Since you didn't write it, I can say this code is bad. When I try to run it, it hits the line
X_AP = evalin('base','X_AP');
and then throws an error, followed by a bunch of similar errors where it tried to read in X_AP from the base workspace. I don't think most good MATLAB programmers would use evalin(). To get this code to work, you'll have to supply us with the code that loaded all the various X_* variables into the base workspace.

8 件のコメント

Milad Zarei
Milad Zarei 2020 年 5 月 11 日
the code reads in bunch of different things. I think you might need them. But I just uploaded the main file that calls that function. Let me know if that helps to run the code.
Image Analyst
Image Analyst 2020 年 5 月 11 日
I get the error
Error using xlsread (line 136)
Unable to open file 'D:\OneDrive\Matlab\work\Tests/Scores.xls'.
File 'D:\OneDrive\Matlab\work\Tests\Scores.xls' not found.
Error in Foot_Scoring2 (line 36)
P_comp = xlsread([save_folder,'/Scores.xls'],'Sheet1','Q1:Q100');
Please attach the Scores.xls workbook and all other files that are needed to run your program.
Milad Zarei
Milad Zarei 2020 年 5 月 11 日
I added that file. This code reads in some tiff images that this website does not let me upload them.
Image Analyst
Image Analyst 2020 年 5 月 11 日
OK, getting further. Now it says:
Index in position 1 exceeds array bounds.
Error in Foot_Scoring2 (line 84)
X_ML_L = imread([path,dirs(3,1).name],2);
so there is still some missing file.
Milad Zarei
Milad Zarei 2020 年 5 月 11 日
those are the files that I can't upload to this website. Here is the link to them: https://pitt.box.com/s/yo6328fodmykjuio5yz8udzyz9yzwvts
Image Analyst
Image Analyst 2020 年 5 月 11 日
I already have some tif files in my folder. Can it be any tiff files or does it need those specifically?
Milad Zarei
Milad Zarei 2020 年 5 月 11 日
it can be anything, the goal is to measure some angles on those images and save the number into that Scores file.
Milad Zarei
Milad Zarei 2020 年 5 月 11 日
I figured that part out. There was no CreateFcn for that variable, so I created that. But now I have another error when I push the Save bottun. I went over the code, there is not even one kind of this at all.
Undefined function or variable 'Angle_B2_DeleteFcn'.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in pic_display (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)pic_display('Angle_B2_DeleteFcn',hObject,eventdata,guidata(hObject))
Error using closereq (line 18)
Error while evaluating UIControl DeleteFcn.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeScripts についてさらに検索

質問済み:

2020 年 5 月 11 日

コメント済み:

2020 年 5 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by