Code covered by the BSD License  

Highlights from

5.0 | 2 ratings Rate this file 28 Downloads (last 30 days) File Size: 6.02 KB File ID: #13845
image thumbnail



Brett Shoelson (view profile)


02 Feb 2007 (Updated )

A new UICONTROL object with a slider as a child of a uipanel, with auto-linked edit box and labels.

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information

An indispensible uicontrol: linked slider, text, and labels all self-contained in a panel.

sliderHandle,panelHandle,editHandle] = sliderPanel(parent, PanelPVs, SliderPVs, EditPVs, LabelPVs, numFormat)
Creates a slider in a separate uipanel, with an associated interactive EditBox, and left and right labels showing the minimum and maximum values of the slider, respectively.

Moving the slider automatically updates the textbox, and vice versa. Both slider movement and text edits will trigger (non-recursively) the callback of the slider.
The EditBox automatically disallows the entry of non-numeric values, or of values outside of [min,max]. Attempts to enter disallowed values will be ignored.
Two syntaxes are supported. One gives FULL control over all elements of the sliderPanel, and a second provides easier access to a subset of the functionality.

UPDATE: Right-clicking the slider now resets the sliderPanel to its default (creation) value.


This file inspired Segment Tool: An Interactive Gui For Segmenting Images and Dynamical System Viewer.

MATLAB release MATLAB 7.3 (R2006b)
Other requirements Created with 2006b and 2007a. I think it's platform-independent. I'm not sure how recent ML needs to be.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
14 Sep 2012 Yogi

Yogi (view profile)

i got it Brett, too basic it was..

14 Sep 2012 Yogi

Yogi (view profile)

hi Brett,can i specify property as "orientation"? i mean if i want vertical slider then which property will help me?

Comment only
05 Feb 2007 John D'Errico

Since most of the sliders I've ever generated also had exactly these uicontrols attached to them, this makes great sense. Thanks for posting it.

I tested it out in both R2006b and in R14SP1 (both on a Mac.) It worked nicely in R2006b, but in the older release, the slider bar would not move properly, and when the figure was resized, the slider bar moved to a different place in the figure. So there appear to be definite problems in older releases.

04 May 2010

added copyright

21 Jun 2010

Updated M file and license text file copyright to The MathWorks, Inc.

10 Oct 2012

Now automatically includes right-click reset to default (initial) value!

29 Nov 2012

Right-clicking the slider now resets the sliderPanel to its default (creation) value.

13 May 2013

Right-clicking now resets the slider to its default (creation) value.

Contact us