f = figure;
p = uipanel(f, 'Position',[0.1 0.1 0.35 0.65]);

c = uicontrol(p,'Style','slider');
c.Value = 0.5;
c.Callback = @sliderMovement;

function sliderMovement(src, ~)
  val = src.Value;
  disp(['Selection: ' num2str(val)]);
end
