0
슬라이더를 만들 때 슬라이더의 최소 및 최대 값을 설정하려고합니다. 슬라이더 단계 및 기본 최소 및 최대 값
function slider2_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
set(hObject, 'Max', 10, 'Min', 1);
하지만 GUI가 열릴 때, 그것을 던져 오류와 슬라이더가
Warning: slider control can not have a Value outside of Min/Max range
Control will not be rendered until all of its parameter values are valid
> In openfig at 135
In gui_mainfcn>local_openfig at 286
In gui_mainfcn at 234
In gui at 44
Warning: slider control can not have a Value outside of Min/Max range
Control will not be rendered until all of its parameter values are valid
Warning: slider control can not have a Value outside of Min/Max range
Control will not be rendered until all of its parameter values are valid
사라지고 난 때 증가/감소 드러그 경우에도 1과 슬라이더 단계를 설정하려고 또는 AM 버튼이 사용됩니다.
function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slider2, 'SliderStep' , [1/9,1/9]);
sliderValue = get(handles.slider2,'Value');
set(handles.edit2,'String',sliderValue)
단위 단계는 내가