From: Adam Chapman on
Im trying to make a simple GUI just as a learning exercise, I've never
made one before.

I have made my simple GUI which loads some data and plots it.

Now I want to have that data available i the matlab workspace.

Is there a function to do that or is it more complex?


From: us on
Adam Chapman <adamchapman1985(a)hotmail.co.uk> wrote in message <a162f378-0ac2-41c1-97a7-989a942f6656(a)s9g2000yqd.googlegroups.com>...
> Im trying to make a simple GUI just as a learning exercise, I've never
> made one before.
>
> I have made my simple GUI which loads some data and plots it.
>
> Now I want to have that data available i the matlab workspace.
>
> Is there a function to do that or is it more complex?
>

a hint:
- use one of the many data containers, eg,

set(0,'userdata',...);
set(gcf,'userdata',...);
help setappdata; % <- and siblings...

us
From: Adam Chapman on
On Jun 20, 2:30 pm, "us " <u...(a)neurol.unizh.ch> wrote:
> Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote in message <a162f378-0ac2-41c1-97a7-989a942f6...(a)s9g2000yqd.googlegroups.com>...
> > Im trying to make a simple GUI just as a learning exercise, I've never
> > made one before.
>
> > I have made my simple GUI which loads some data and plots it.
>
> > Now I want to have that data available i the matlab workspace.
>
> > Is there a function to do that or is it more complex?
>
> a hint:
> - use one of the many data containers, eg,
>
>      set(0,'userdata',...);
>      set(gcf,'userdata',...);
>      help setappdata;     % <- and siblings...
>
> us

I appreciate the response but didn't have much luck with that.

Perhaps I should explain the data is not in graphical form. Basically
all the button on my GUI does is load some data from a text file.

It looks as though your suggestion needs the data to be shown in a
figure before copying it to the workspace (correct me if im wrong).

From: us on
Adam Chapman <adamchapman1985(a)hotmail.co.uk> wrote in message <e1dc2db0-1c21-4c1d-a869-33fa537c1762(a)k39g2000yqd.googlegroups.com>...
> On Jun 20, 2:30 pm, "us " <u...(a)neurol.unizh.ch> wrote:
> > Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote in message <a162f378-0ac2-41c1-97a7-989a942f6...(a)s9g2000yqd.googlegroups.com>...
> > > Im trying to make a simple GUI just as a learning exercise, I've never
> > > made one before.
> >
> > > I have made my simple GUI which loads some data and plots it.
> >
> > > Now I want to have that data available i the matlab workspace.
> >
> > > Is there a function to do that or is it more complex?
> >
> > a hint:
> > - use one of the many data containers, eg,
> >
> >      set(0,'userdata',...);
> >      set(gcf,'userdata',...);
> >      help setappdata;     % <- and siblings...
> >
> > us
>
> I appreciate the response but didn't have much luck with that.
>
> Perhaps I should explain the data is not in graphical form. Basically
> all the button on my GUI does is load some data from a text file.
>
> It looks as though your suggestion needs the data to be shown in a
> figure before copying it to the workspace (correct me if im wrong).

NO, not at all...
better have a second look, eg,

set(0,'userdata',...); % <- the root is NOT a fig...
% did you look at this at all(?)...
help setappdata; % <- and siblings...

us
From: Adam Chapman on
On Jun 20, 3:19 pm, "us " <u...(a)neurol.unizh.ch> wrote:
> Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote in message <e1dc2db0-1c21-4c1d-a869-33fa537c1...(a)k39g2000yqd.googlegroups.com>...
> > On Jun 20, 2:30 pm, "us " <u...(a)neurol.unizh.ch> wrote:
> > > Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote in message <a162f378-0ac2-41c1-97a7-989a942f6...(a)s9g2000yqd.googlegroups.com>...
> > > > Im trying to make a simple GUI just as a learning exercise, I've never
> > > > made one before.
>
> > > > I have made my simple GUI which loads some data and plots it.
>
> > > > Now I want to have that data available i the matlab workspace.
>
> > > > Is there a function to do that or is it more complex?
>
> > > a hint:
> > > - use one of the many data containers, eg,
>
> > >      set(0,'userdata',...);
> > >      set(gcf,'userdata',...);
> > >      help setappdata;     % <- and siblings...
>
> > > us
>
> > I appreciate the response but didn't have much luck with that.
>
> > Perhaps I should explain the data is not in graphical form. Basically
> > all the button on my GUI does is load some data from a text file.
>
> > It looks as though your suggestion needs the data to be shown in a
> > figure before copying it to the workspace (correct me if im wrong).
>
> NO, not at all...
> better have a second look, eg,
>
>      set(0,'userdata',...);     % <- the root is NOT a fig...
> % did you look at this at all(?)...
>      help setappdata;     % <- and siblings...
>
> us- Hide quoted text -
>
> - Show quoted text -

I have a variable called 'V' that is loaded from the text file with
one of my button callback functions.

Ive tried:
h=setappdata(0,'V',V) and h=set(0,'V',V)

but to no avail.

The first line of my GUI script is:
function [t V F]=myGUI

do i need to scrap the output format and use:

function h=myGUI

?