Code covered by the BSD License  

Highlights from
ipanel

5.0

5.0 | 2 ratings Rate this file 20 Downloads (last 30 days) File Size: 7.84 KB File ID: #39537
image thumbnail

ipanel

by

 

21 Dec 2012 (Updated )

Implements a controller panel to provide a primitive MATHEMATICA-'Manipulate'-like facility.

| Watch this File

File Information
Description

This class adds a panel containing slider/checkbox/popupmenu controllers to provide a primitive MATHEMATICA-'Manipulate'-like facility.

A function handle that accepts aribtrary number of parameters is passed in with respective controller specification. Each parameter gets associated with a controller and becomes a 'controlled parameter'. The controllers can be used to adjust the parameters, and thereby manipulate the function (and the graphics).

For example, the attached figure was generated using:
>> x = 0:.001:1;
>> ipanel(@(a,b)plot(x,sin(2*pi*a*x)+cos(2*pi*b*x)),{'slider','Frequency 1',{0,10,1}},{'slider','Frequency 2',{0,10,5}},'MinControlWidth',250,'LabelWidth',100)

For details please check:
>> help ipanel.ipanel

Public methods: Try 'help ipanel.funcname' for help on each 'funcname'
- ipanel (constructor; adds ipanel and controllers)
- remove (removes ipanel and the controllers from a figure)
- getControllers (provides handles to the ipanel's internals)
- getData (returns the values of controlled parameters)
- display (display current values of the controlled parameters)

Author : Damith Senaratne, (http://www.damiths.info)
Released date : 19th December 2012

Required Products MATLAB
MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
12 Sep 2013 Jonathan

This is great! I agree with Jesus. It would be awesome if this update in real time, but maybe that is very difficult to do.

08 Aug 2013 Damith Senaratne

Just found that 'ipanel' crashes when trying to resize or use ipanel while panning a zoomed figure. This is because a child object of type 'uicontextmenu' is created under Figure and 'ipanel' tries to access its Units.
Replacing line 643: "hCh = get(this.hFigure,'Children');" with "hCh = findobj(this.hFigure,'type','axes');" would fix the bug.
I would include the bug fix in the next version of 'ipanel'.

25 Jan 2013 Jesús Lucio

Perfect! Great code, similar in functionality to Mathematica's "Manipulate", as the author asserts. Only one question: could it be possible for MALTAB to draw while the user is touching the slider? (something like 'drawnow')
Very good, and thanks a lot, Damith.

Updates
26 Dec 2012

Updated the title, removed a part of the description I had included there with the file name. No change done to the m-file or its description on this site.

Contact us