|
I ended up using
m=rand(m,n);
set(hObject,'Userdata',m) and it worked totally fine
thanks guys
"Malcolm McLean" <malcolm.mclean5@btinternet.com> wrote in message <i7pvbk$5dd$1@fred.mathworks.com>...
> "Alex Ter-Sarkissov" <ater1980@gmail.com> wrote in message <i7pqg0$ih2$1@fred.mathworks.com>...
> > hi, here's the problem:
> >
> > let's say I have 2 buttons. The first 1 generates, say, a KxK matrix of random numbers. The second one takes this matrix as an input variable and, say, multiplies them by 2 (just 4 example). How should I store the output of the 1st callback function, so that it can be taken as an input by the callback of the second button?
> >
> > Sorry if it was a bit messy.
> >
> Callbacks can be local to the function that creates the button. So have a "rndmtx" variable in the workspace of the main GUI function, and create the buttons. You also probably want to create a uitable object so the user can see the data.
> When he presses button 1, the callback sets rndmtx to random, and updates the table. When he presses button 2, the callback sets rndmtx to rndmtx .* 2, and again updates the table.
|