필터 지우기
필터 지우기

pushbutton problem

조회 수: 1 (최근 30일)
Sahab
Sahab 2011년 5월 13일
did someone has a code or example for pushbutton(using GUIDE) that every time we click the button,data will save in cell array. for an example,for the first click of that button,the result will save in x(1,1),then when i click for the second times,the result will save at x(1,2) and so on for the next click. did GUIDE can do this?if yes,can someone provide me some example? thanks.
  댓글 수: 1
Andy
Andy 2011년 5월 13일
Have you read the documentation for building GUIs in GUIDE? It describes multiple ways of storing information in your GUI, and passing information from one control to the next. Also, you should look through Matt Fig's GUI examples from the FEX (these are programmatic, not from GUIDE, but very instructive): <http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples>

댓글을 달려면 로그인하십시오.

채택된 답변

Paulo Silva
Paulo Silva 2011년 5월 13일
Use the handles structure, in the OpeningFcn initialize variable n and x
handles.n=1;
handles.x=cell(1,1);
% Update handles structure
guidata(hObject, handles);
In your button callback
n=handles.n;
x=handles.x;
x{1,n}=YourData; %replace YourData for what you want to save
handles.n=n+1;
handles.x=x;
% Update handles structure
guidata(hObject, handles);
  댓글 수: 1
Sahab
Sahab 2011년 5월 13일
thanks..it what i need.. :D

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by