GUI: adjust axes values with 2 different sliders
Afficher commentaires plus anciens
I want to select 2 values chosen by 2 different sliders and set these values as the min and max of an axes. So, slider_a should give the min value of the axes, slider_b the max value of the axes. I failed to do so... here my initial code:
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (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
slider1_val=get(handles.slider1,'value')
set(handles.text1,'string',slider1_val)
get(handles.axes1,'Xlim')
set(handles.axes1,'Xlim',slider1_val) %%x min value should be slider1 val.; max slider2 val.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!