Problem with saving the Data of programmaticaly created uitable
이전 댓글 표시
I create a variable size uitable programmaticly (not using GUIDE) which works well. What I am struggling with is saving the content of the created table, it keeps telling "Reference to non-existent field 'load_table'". Even if I try to save it in another callback it keeps telling the same error. Any ideas? much appreciated.
댓글 수: 3
Jan
2016년 1월 15일
Without seeing the code it is impossible to guess, where the error is. So please edit your question and insert the relevant part of the code and a copy of the complete error message.
Mus'ab Ahmad
2016년 1월 15일
편집: Stephen23
2016년 1월 15일
Mus'ab Ahmad
2016년 1월 15일
답변 (1개)
Walter Roberson
2016년 1월 15일
0 개 추천
You use handles.load_table but you never created that. You created load_table without storing it in handles
댓글 수: 3
Mus'ab Ahmad
2016년 1월 15일
편집: Walter Roberson
2016년 1월 15일
Walter Roberson
2016년 1월 15일
guihandles(load_table) looks through the figure that contains the load_table graphics object and finds all graphics objects with non-empty Tag where the Tag is a legal variable name, and creates a structure with one field for each of those tags.
When you then guidata() that structure, it effectively becomes (or replaces) the handles structure for all later calls.
If, in a later routine, you then try to access handles.table_handles that field would only exist if there had been a graphics object with Tag 'table_handles'
The uitable() that you are creating have no Tag, so even if they were created before the guihandles() call then they would not be recorded in the structure.
What you probably want is that once your handles structure has been created, and you have assigned table_handles the appropriate uitable() value,
handles.table_handles = table_handles;
guidata(hObject, handles);
Mus'ab Ahmad
2016년 1월 19일
편집: Walter Roberson
2016년 1월 19일
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!