"Falofolio " <falofolio@tiscali.nl> wrote in message
news:f9enre$9o$1@fred.mathworks.com...
> Hi,
>
> I am trying to use my own home-made private functions with my scripts.
> However, MATLAB R2007a (for PPC-Mac) just do not want to see my private
> functions.
>
> I have created a folder called 'private' containing my functions within
> the folder,
> where my scripts are located. However, the error message I always receive,
> when
> putting a function in the 'private' folder is:
>
> ??? Undefined function or method 'myfunction' for input arguments of type
> 'char'.
>
> FYI: all folders that contain a folder 'private' are set in my path.
>
> I call these private functions the same way as I call non-private
> functions. Is that
> correct? Or, do I need to use some special statement to call a private
> function?
The only functions that can call a function in a directory named private are
the functions in the directory containing that private directory. For
instance, if you look in the $MATLAB/toolbox/matlab/elmat/private directory
in your installation ($MATLAB is your MATLAB installation's root directory),
you'll see a number of functions that the GALLERY function uses to generate
matrices. One of the functions you should see is moler.m. The only
functions that can call that moler.m function are functions in
$MATLAB/toolbox/matlab/elmat.
Read this for more information on private functions:
http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_prog/f4-70335.html
From your description, it sounds like what you want to do is create your own
directory to store your files. I recommend _not_ placing the directory you
create in a directory under $MATLAB/toolbox, where again $MATLAB is your
MATLAB root directory. Once you have your files in that directory, add it
to your MATLAB path using the PATHTOOL or the ADDPATH function. This will
allow MATLAB to "see" your files. For more information on the MATLAB search
path, you can read this page from the documentation:
http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_env/f10-26235.html
--
Steve Lord
slord@mathworks.com