4.8 | 5 ratings Rate this file 26 Downloads (last 30 days) File Size: 11.8 KB File ID: #28076 Version: 1.0
image thumbnail

Function Parameter Slider



Use continuously updating sliders to view how a function changes as its input parameters change

| Watch this File

File Information


Given a function with several (up to 5) inputs, and several outputs,
[z1, z2, ...] = f(x1,...,x5)

Function Slider lets you vary the input values x1...x5 using continuously updating sliders, and then viewing the results using any arbitrary MATLAB expression on the outputs (z1,z2...).

The input function, output (plotting) function, and slider values/limits are all user settable.

I wrote this with a hard coded limit of 5 sliders in this GUI, but it probably wouldn't be too hard to change this.

The HELP shows several examples that should hopefully make this clear.

Known issues:
There may be some difficulties with trying to keep the view exactly the same when the lock command is checked.

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
26 Jul 2015 nicokla

On Matlab 2015a, I think there has been a change that make the code need an update to make it work : all the || and the && should be replaced by | and &, because the || and the && raise this error :
Operands to the || and &&
operators must be
convertible to logical
scalar values.
ie, there is a problem when we try to use them on matrices. I made a ctrl/f, then replace all for the && and the || into & and |, and then the code worked perfectly.

12 Mar 2014 Leandro

really easy to use!

01 May 2013 Alec MacKendrick

I think it is ace and is way beyond anything I could do.

I'm still cheeky enough to suggest some improvements though:

Like Marc, I wanted to edit the default min and max, and found values on lines 921 and 1001, but still needed to click in the box and press enter for them to effect the value that the slider returns.

It'd be great if the context menu of the output plot still worked (so I could check peak response on a step plot for example).

The lock x and y axes buttons didn't seem to work for my plotyy graph.

Still brilliant.

Comment only
01 May 2013 Alec MacKendrick  
28 Nov 2012 Dan Ellis

Dan Ellis (view profile)

Love it. Did exactly what I wanted, worked first time, I never have to know what the Matlab primitives for sliders are!

Comment only
28 Nov 2012 Dan Ellis

Dan Ellis (view profile)

24 Aug 2012 Matthew

This works perfectly and is everything I ever dreamed of and more in a function slider. You are my hero.

05 Jun 2012 Marc

Marc (view profile)

Hi Teja,

I'm adapting this for a particular application- working quite well, except I can't figure out how to set different starting minimum, maximum and values for the sliders. Can you point me in the right direction?



Comment only

Contact us