function within a gui set function
显示 更早的评论
Is it possible call upon a tag name in a gui which is dependent on a changing number? Here's my code and what I'm trying to do:
Upon opening, I set i=[0 0 0 0]. As the zeros turn to 1s in the vector, I want to change the color of different text boxes. The tags on my text boxes are named 'attempt1_1' 'attempt1_2' 'attempt1_3' and so on. In the set function, is there a way to call upon a variable to change the "number" in handles.attempt1_number?
function Red_p_Callback(hObject, eventdata, handles)
% hObject handle to Red_p (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
nextempty=find(i==0);
set(handles.attempt1_nextempty(1),'BackgroundColor','r')
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!