라디오 버튼을 누르면 선을 추가하려는 imagesc로 2 차원 플롯 (hhh 핸들)을 작성하고 푸시 버튼을 놓으면 동일한 선을 제거합니다.matlab uicontrol radiobutton 문제
불확정 함수 또는 변수 'Hline'
Lokks 프로그램이 Hline 기억 할수 없어 라인 : 누름 버튼 라인을 누를
는 누름 버튼이 해제 될 경우,이 오차가, OK 도시 심지어 guidata로 업데이트되고있다. 내가 도대체 뭘 잘못하고있는 겁니까? 이 ABC의 범위에 존재하는 서면으로If you define additional input arguments, then the values you pass to the callback must exist in the workspace when the end user triggers the callback.
, 함수는 (Hline의 가치를 전달합니다 : 여기
감사
함수 콜백의 documentation에서function abc(x)
% x is a m x n matrix
hhh=imagesc(x)
% now a pushbutton to put or remove a line in the above plot
uicontrol('Style','radiobutton','String','put_remove_line',...
'units','normalized','pos', [tf_left 0 .1/2 1/25],'parent',hhh,'HandleVisibility','on', 'fontSize',6,'Callback',{@put_remove_line ,delta_f_line, hhh ,Hline});
end % end abc function
%radiobutton callback function
function put_remove_line(hObject,event,delta_f_line,hhh,Hline)
a=get(hObject,'Value');
if a % if button is pressed a
axes(hhh)
xlimits=get(gca,'XLim');
Hline.xxx=line(xlimits,[delta_f_line], 'LineStyle',':','LineWidth',2);
else
delete(Hline.xxx,)
end
guidata(hObject,Hline)
end
많은 분들께 감사드립니다. 당분간 최고의 솔루션이 아닌 것처럼 보이는 글로벌 xxx를 사용하고 있습니다 ... –