how can i choose data in the popupmenu in GUI?

hello everyone, i have data that is for two months, January and July, the data is called class9_data, i already programmed the push-button to execute some analysis, but the thing is how can i tell the function to choose the month of data first then execute the function, i wrote this code but it is not working: Note: K is an index representing the two months or the two files to be read. please help
cla;
M{K}=Class9_data{K};
state=get(handles.popupmenu1,'value');
switch state
case 1
set(handles.push1,'Class9_data{K}',all_mat(MonthName{K} == 1, :));
case 2
set(handles.push1,'Class9_data{K}',all_mat(MonthName{K} == 7, :));
end

3 个评论

set(handles.push1,'Class9_data{K}',...)
Is trying to set a literal property named "Class9_data{K}" of a pushbutton object. This can't work.
Calling set doesn't execute the button's callback if that's what you're going for. Provide some more detail and we might be able to help you.
Thank you very much, I solved it, how can I please accept your answer?
I posted a comment rather than an answer, so there's nothing to accept.
Glad you got it working.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 General Applications 的更多信息

标签

评论:

2017-12-5

Community Treasure Hunt

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

Start Hunting!

Translated by