|
In article <h4kqpa$l9r$1@fred.mathworks.com>,
"Pat Finder" <pfinder@netacc.net> wrote:
> I am interested in hearing ideas about the best ways to create "modules" in
> matlab?
>
> The goal is to have one interface, where I can easily switch routines, and
> have different versions of the routine run.
>
> For example, suppose I have a routine to recognize license plates. It needs
> to be initialized, and then on subsequent calls it needs to be run.
>
> Later one, I want to swap the license plate recognition file, with another
> one, and have the new one take effect.
>
> Is there an established 'best practice' for this in Matlab?
>
> - Pat
>
> [ I'm upgrading to Matlab 2009a, from 2005<something>. ]
Hi "Pat",
One way to do this would be to manipulate the MATLAB path -- removing
the directory with the old routine and adding the directory with the new
one.
You could also do it with function handles:
function_to_use = @function1;
y1 = function_to_use(x);
function_to_use = @function2;
y2 = function_to_use(x);
but with this you have to give the two functions different names since
they will both be on the path at the same time.
--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
|