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とスライダーステップを設定しようとしたりしていますボタンが使用されます。
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)
単位ステップのために、私は