Storing arrays with guidata/Userdata
조회 수: 2 (최근 30일)
이전 댓글 표시
Im having a hard time wrapping my head around how I might go around storing an array for later use using my gui. I want to be able to store an array called LN using a pushbutton but im not entirely sure how to tackle it. I dont need anything too complex I just want to be able to see an example and figure out where to start. Ive looked over guidata and Userdata functions. I came to the conclusion guidata may be more functional for my current project, but other than using it within a figure, im not sure how to store LN with the press of the pushbuttons I have.
채택된 답변
추가 답변 (1개)
Walter Roberson
2023년 11월 14일
function Myproj_Button1_Callback(hObject, event, ~)
handles = guidata(hObject) ;
handles.LN = magic(7);
guidata(hObject, handles);
function Myproj_GoButton(hObject, event, ~)
handles = guidata(hObject);
LN = handles.LN;
If you are using guide then some simplifications are possible
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!