Re: Question on Overloaded Functions
- From: Doug Schwarz <see@xxxxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 20:59:36 -0400
Michelle Scala wrote:
I am teaching myself Matlab for a new job.
I understand the concept of overloaded functions from my course work
in C++.
What I don't understand is how do I save 2 or more functions with the
same name in the same directory?
For example, I want to create these an overloaded function - one that
accepts a double and the other that accepts an int.
So I do:
function myFunction (int) and another one that is function myFunction
(double).
Obviously I can't save both files are myFunction.m in the same
directory.
Am am confused as what to do. Thank you for helping.
You create your double version of myFunction.m and put it in a directory
called @double which is in a directory on the MATLAB path. Next you have to
decide which integer data type you are using for the integer version of
myFunction, let's say you choose uint8. Then you put the integer version of
your function in a directory called @uint8 which is in a directory on the
path. Do not add @double or @uint8 to the path.
--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
.
- References:
- Question on Overloaded Functions
- From: Michelle Scala
- Question on Overloaded Functions
- Prev by Date: Re: Calculating empirical distributions
- Next by Date: Re: Unusual Linear Mapping??
- Previous by thread: Question on Overloaded Functions
- Next by thread: sending a message to mobile via bluetooth
- Index(es):
Relevant Pages
|