how to write call back for slider

1 次查看(过去 30 天)
rafi abdul
rafi abdul 2013-3-21
my requirement is to slide the plots along x-axis.in my graph i have multiple axis and i have set xlim for all graphs am able to slide both sides .but when i zoom the plots and xlim will get changed and when i try to slide the zoomed plots slider should take the new limits of the zoomed plots as min and max.how to write callback for slider .please help.
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)
h(1)=handles.h(1); %handles of axis1
h(2)=handles.h(2); %handles of axis2
h(3)=handles.h(3); %handles of axis3
value=get(hObject,'value');
x=0:1310680;
hax = [h(1);h(2);h(3)];
if value>=0
set(hax,'XLim',[min(x),max(x)]+.5*get(hObject,'value'));
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by