puppeteer
A MATLAB class that can control anything.
The Problem:
- You have a simulation or a function with some parameters. It's complicated
- You want to get a feel for it by twiddling the parameters and seeing how it changes
- It's a pain to write bespoke wrappers for your code and worry about UI generation
The solution
puppeteer does all the hard work of generating UI elements for you.
Generate a new puppeteer instance and tell it the parameters you want to manipulate:
% these are the parameters you want to change
A = 1;
B = 2;
% with corresponding lower
% bound and upper bounds
lb = [0 0];
ub = [2 5];
p = puppeteer({'A','B'},[A; B],lb,ub,[]);
puppeteer then generates a figure with sliders that allows you to control these parameters. The nice thing now is that any changes you make in the sliders are reflected in the puppeteer object:
p.parameters % stores the updated value, always
Now, there are two ways to hook up puppeteer to your simulation so that changes in puppeteer affect your simulation.
The first is simple: your simulation simply polls p.parameters, and changes its parameters based on that.
The second allows you to configure a callback function so that puppeteer will call this every time you change a parameter.
p.callback_function = my_function_handle;
% puppeteer will call this function with the parameters argument
License
GPL 3. puppeteer is free software.


