Hello everyone,
i would like to get a slider which controls a bar plot.
so i got this, but instead of the gauge i would like to have a bar plot which is changing while i move the slider.
at the end i need 4 – 5 different bars which are chancing individually depending on different functions. and there is a same variable which is in each functions and this should be the input from the slider.
function sliderchanging% Create figure window and components
fig = uifigure('Position',[100 100 350 275]);cg = uigauge(fig,'Position',[100 100 120 120]);cg.MajorTicks = [0:10:100];cg.MajorTickLabels = {'0','10','20','30','40','50','60','70','80','90','100'};sld = uislider(fig,... 'Position',[100 75 120 3],'ValueChangingFcn',@(sld,event) sliderMoving(event,cg)); end% Create ValueChangingFcn callback
function sliderMoving(event,cg)cg.Value = event.Value;end
Best Answer