- Check if the field ‘categories’ is defined in the initialization function. To check this, you can make use of ‘isfield’ function.
- As MATLAB is case sensitive, verify the spelling and case sensitivity of the field name.
- Ensure that the code that assigns value to the ‘categories’ field is executed before the line “categories = handles.categories” is reached.
Hi, help me in this error: unrecognized field name 'categories'.
조회 수: 214 (최근 30일)
이전 댓글 표시
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
categories=handles.categories;
congMat(1)=handles.congMat(1);
congMat(22)=handles.congMat(22);
congMat(43)=handles.congMat(43);
congMat(64)=handles.congMat(64);
congMat(85)=handles.congMat(85);
congMat(106)=handles.congMat(106);
congMat(127)=handles.congMat(127);
congMat(148)=handles.congMat(148);
congMat(169)=handles.congMat(169);
congMat(190)=handles.congMat(190);
congMat(211)=handles.congMat(211);
congMat(232)=handles.congMat(232);
congMat(253)=handles.congMat(253);
congMat(274)=handles.congMat(274);
congMat(295)=handles.congMat(295);
congMat(316)=handles.congMat(316);
congMat(337)=handles.congMat(337);
congMat(358)=handles.congMat(258);
congMat(379)=handles.congMat(379);
congMat(400)=handles.congMat(400);
댓글 수: 0
답변 (1개)
Ishu
2023년 8월 28일
Hi Afiq,
The error message “unrecognized field name ‘categories’” indicates that the field name ‘categories’ does not exist within the handles structure.
Before using ‘categories’ field you need to ensure that the field 'categories' is correctly defined and initialized within the ‘handles’ structure. To ensure this you can follow these steps:
For more information on ‘isfield’ function you can refer to this documentation:
Hope it helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!