I've been facing this issue the issue is with axes
2 ビュー (過去 30 日間)
古いコメントを表示
ERROR:
The class handle has no Constant property or Static method named 'axes1'.
Error in untitled>UPLOADIM_Callback (line 84)
axes(handle.axes1);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in untitled (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)untitled('UPLOADIM_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
THE LINE WHERE ERROR IS
function UPLOADIM_Callback(hObject, eventdata, handles)
% hObject handle to UPLOADIM (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=uigetfile('.jpg');
a=imread(a);
axes(handle.axes1);
imshow(a);
setappdat(0,'a',a);
0 件のコメント
採用された回答
Steven Lord
2021 年 6 月 18 日
function UPLOADIM_Callback(hObject, eventdata, handles)
% hObject handle to UPLOADIM (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=uigetfile('.jpg');
a=imread(a);
axes(handle.axes1);
The third input to the callback function is named handles (plural).
On the last line of the excerpt of your code I've quoted you're trying to index into something named handle (singular). That's trying to access a property or call a static method on the handle class, and that class has no property or static method named axes1.
To fix this, add the missing s on this last line.
3 件のコメント
Steven Lord
2021 年 6 月 18 日
I recommend you post your questions here on Answers. If the questions are about something that's mostly or completely unrelated to this question, please post it as a new discussion (perhaps with a link to this existing question for context.)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!