Saving data after pressing SAVE button in GUI MATLAB
이전 댓글 표시
I have five push buttons. The four pushbuttons are associated with different datas like for eg one is for age of female and their corresponding weight. Pushbutton2 is associated with data for age of male and their weight. Similarly pushbutton3 and pushbutton 4 relates to other data. There is also a SAVE pushbutton. When I press pushbutton1 and after that press SAVE pushbutton, I should be able to browse my system and give path for saving data in excel file. Similarly, I should be able to do for all other pushbuttons as well. I am not getting idea how to denote that one particular pushbutton is pressed. I was thinking of changing the background color of the button when I press it and relate it using if-else statement. I want my code in the SAVE button callback function sthg to be like:
If pushbutton1 is pressed
\\extract data, give directory and save data
else if pushbutton2 is pressed
\\extract data, give directory and save data
else if pushbutton3 is pressed
\\extract data, give directory and save data
else if pushbutton4 is pressed
\\extract data, give directory and save data
댓글 수: 2
Geoff Hayes
2022년 6월 23일
@Sush Gautam - what does pressing the buttons (1-4) actually do? Is something loaded? Are variables populated? You may want to add some sort of common behaviour to all four buttons so that it doesn't matter which button was pressed when you then press "save". i.e. you could save the data to one more variables (array, etc.) and then those variables would be used when saving to file.
Sush Gautam
2022년 6월 23일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!