From: M Paheerathan on
Dear Guys,

I have a small Issue. Please help me to sort out

I have a function like

function selectPointsLT_Callback(hObject, eventdata, handles)
[x,y]= ginput(5);

LTx1 = num2str(x(1));
LTy1 = num2str(y(1));
...........................................


Here [X,Y] is a array (length 5) and I would like to access the [x,y] array in another function. For that how I should define the [x,y] array.


Thank you,


Best Regards,
Paheerathan
From: Steven Lord on

"M Paheerathan" <mp.mscproject(a)yahoo.com> wrote in message
news:hv52kg$10k$1(a)fred.mathworks.com...
> Dear Guys,
>
> I have a small Issue. Please help me to sort out
>
> I have a function like
>
> function selectPointsLT_Callback(hObject, eventdata, handles)
> [x,y]= ginput(5);
>
> LTx1 = num2str(x(1));
> LTy1 = num2str(y(1));
> ..........................................
>
>
> Here [X,Y] is a array (length 5) and I would like to access the [x,y]
> array in another function. For that how I should define the [x,y] array.

From your function signature I'm assuming you're using GUIDE. If so, read
this section from the documentation:

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_guis/f5-998197.html

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: M Paheerathan on
Dear Steve Lord,

Even though it is from MatLAB GUI, what I'm asking

Say for example

function1()
[x,y]=ginput(5);



function2()
%I want to access [x,y] array without passing it as a parameter. Because I want to access lot of arrays like [x,y] in function 2
%Simply I'm asking, is there anyway to define [x,y] in function 1 to access the values in function 2
From: Matt Fig on
The page Steven Lord pointed you to deals with the issue, did you look at it? There are myriad ways of data sharing in functions surrounding GUIs.

Look at the help for GUIDATA for a common method.
From: M Paheerathan on
Done. Thanks Steve.


"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hv6s22$cg3$1(a)fred.mathworks.com>...
> The page Steven Lord pointed you to deals with the issue, did you look at it? There are myriad ways of data sharing in functions surrounding GUIs.
>
> Look at the help for GUIDATA for a common method.