[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating 'Forms' in Octave

From: Pantxo Diribarne
Subject: Re: Creating 'Forms' in Octave
Date: Tue, 30 Aug 2016 20:01:48 +0200

Le 30/08/2016 à 16:24, Chip Wachob a écrit :

So I've been able to create the dialog that I need, and I've gotten it to run through my calculations.

Now, the big question is how to make the dialog 'sticky'.

I want the data in the dialog to remain so I can go back and change one variable and have it recalculate.

It would also be great if the form didn't disappear when I say 'OK' to run the calculations.

Any suggestions on how to accomplish this?

Thank you,

On Tue, Aug 23, 2016 at 11:21 AM, Pantxo <address@hidden> wrote:
Chip Wachob wrote
> Hello,
> I'm still very new to the Octave tool, so I apologize if this is a repeat.
> I searched the archives but probably didn't use the right keyword..
> I'd like to know if there is a simple way of creating a 'form' or dialog
> box in Octave that would allow me to change the value(s) of various
> variables, but retain the previous values of others. After changing the
> input, I'd like to click on a 'button' that would recalculate the results
> and update a plot window.
> The function that I'm using currently requires eight inputs.  I've
> successfully written a script (using input()) that will allow me to type
> in
> those inputs manually, each time, but usually I'm only changing one
> variable at a time and it sure would be a lot simpler if I could change
> that variable and 'update' the plot.
> I looked at the Java section (Section 37?) but I was not able to get any
> of
> the Java commands to work.  It seems that perhaps I'm missing a
> "Java-Octave" plugin, but when I attempted to install the plugin, it told
> me the host didn't exist..
> If there is an example out there that would allow me to learn how this is
> done, that would be great.
> Can anyone offer up a starting place?  A link to a tutorial or example
> would be great.
> BTW, I don't actually know Java or Python, and I'd prefer not to have to
> learn it in the midst of learning Octave if I don't have to.
> Version 4.0.3.  Both in Windoze and Ubuntu.
> Thank you in advance for your help,
> _______________________________________________
> Help-octave mailing list

> Help-octave@



What you describe looks simple enough to be done with inputdlg, see "demo
If you need a more fine control on the user interface you could use
uicontrol , which unfortunately currently has no demo but is expected to
work as in Matlab.


View this message in context:
Sent from the Octave - General mailing list archive at

Help-octave mailing list

As I said you can build more complex, and non modal, gui using "uicontrol" objects. Those are basically buttons, text boxes, ..., that you put onto a figure object. Here is a very basic example:

hf = figure ("position", [0 0 200, 300], "name", "PLUS App", "numbertitle", "off", "menubar", "none");
hp = uipanel ();

datanames = {"A", "B"};
for ii = 1:2
  hh(ii) = uicontrol ("style", "edit", "position", [25 ii*100 150 30], ...
             "backgroundcolor", "w")
  uicontrol ("style", "text", "position", [25 ii*100+40 150 30], ...
             "string", datanames{ii})

fcn = @() disp (str2num (get (hh(1), "string")) + str2num (get (hh(2), "string")))

uicontrol ("style", "pushbutton", "callback", fcn, "position", [50 25 100 40], ...
           "string", "Go!")

You could also post in this thread ( which is about creating uixx examples.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]