Thread Subject: How to plot in GUI data inserted by edit box?

Subject: How to plot in GUI data inserted by edit box?

From: Andr? Zibetti

Date: 27 Jul, 2008 20:13:03

Message: 1 of 2

Hi guys,

Could you guys help me to figure out how can I plot (in GUI)
some data points inserted in a edit box (or table) after
confirm by pushing a button??

I wanna build a GUI that I can insert data point and confirm
one by one and then this points be ploted in same GUI (axes).

thanks a lot in advance!!

Subject: How to plot in GUI data inserted by edit box?

From: Andre Zibetti

Date: 28 Jul, 2008 04:01:08

Message: 2 of 2

"Andr? Zibetti" <shidao@gmail.com> wrote in message
<g6iksf$21p$1@fred.mathworks.com>...
> Hi guys,
>
> Could you guys help me to figure out how can I plot (in GUI)
> some data points inserted in a edit box (or table) after
> confirm by pushing a button??
>
> I wanna build a GUI that I can insert data point and confirm
> one by one and then this points be ploted in same GUI (axes).
>
> thanks a lot in advance!!

Hi again, :)

I think that I already figure out my own question. Here is
the code:

in GUI callback, immediatly after %vargi... insert:
x=[0]
y=[0]
handles.x=x;
handles.y=y;

to create your vector and set them in handle structure

In GUI create the axes, two edit box, 2 static text box and
1 button.

In the callback button insert the code:
a = get(handles.edit1,'string')
set(handles.text1,'string',a)
X =str2double(a)

b = get(handles.edit2,'string')
set(handles.text4,'string',b)
Y =str2double(b)

handles.y(end+1) = Y
handles.x(end+1) = X

xmin = min(handles.x); ymin = min(handles.y);
xmax = max(handles.x); ymax = max(handles.y);
xx = xmin:0.1:xmax;
yy = spline(handles.x,handles.y,xx)
plot(handles.x,handles.y,'o',xx,yy)
guidata(hObject,handles)

done!!!

This is GUI that you can create your plot inserting values
right on edit box in GUI.


It's not a big deal, but's it my first time that I made
something in matlab GUI, so :))...

Thanks

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gui plot data p... Andre Zibetti 27 Jul, 2008 16:15:11
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com