Date: Dec 30, 2012 2:17 AM
Author: Matt J
Subject: Re: Event Object for Datacursormode

"Nima Nikvand" <nnikvand@uwaterloo.ca> wrote in message <kbonu5$ppk$1@newscl01ah.mathworks.com>...
> Hi Matt,
>
> Thank you for your reply. Can you please give me an example of how to make it into a nested function? much appreciated.


Run the following to get the general idea.

function test


txtCopy=[];
posCopy=[];


datatextbox(2,1);

txtCopy, %3
posCopy, %1

datatextbox(4,4);

txtCopy, %8
posCopy, %0



function [txt,pos] = datatextbox(a,b)

txt=a+b;
pos=a-b;

txtCopy=txt;
posCopy=pos;


end


end