[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Passing numbers from edit field to graph
From: |
Richardson, Anthony |
Subject: |
RE: Passing numbers from edit field to graph |
Date: |
Mon, 7 Jan 2019 14:41:33 +0000 |
> Subject: Passing numbers from edit field to graph
>
> Dear Support-Team,
>
> I am programming a Graphical User Interface to create simple graphs. Find a
> attached my created interface (gui.docx) and my code
> (ButtonsTools.txt). I want that when I type in a number in the edit field
> xmin, xmax and xstep that the x-axis is adapt, but I don´t
> know the suitable command for it. Can you help me?
> So what I actually want is, that x=xmin:xstep:xmax, but I don´t know how to
> hand over it to the GUI.
>
> Thank you for your help.
>
> Carola Forster
Hi Carola,
I've been working on something very similar. You need to add a callback
function that is automatically run when the edit field is changed. The
callback will need to get the new value from the control element and then
replot the graph.
I have attached an m-file that illustrates the procedure. (By default the
x-axis is autoscaled, but you can click on the "AUTO" button to switch to
"MANUAL" mode and then enter new values in the "min" and "max" edit controls.)
I hope this helps.
Tony Richardson
p.s. The attached script allows the user to explore function composition using
unit step and unit ramp functions.
sim00_01.m
Description: sim00_01.m