Thread Subject: Call self-made functions without m-File in current directory

Subject: Call self-made functions without m-File in current directory

From: Jonas Baumann

Date: 12 Oct, 2009 14:10:22

Message: 1 of 3

Over time I accumulated a few very simple tough (for me) very useful) functions that I reuse often during all kinds of tasks.

Up to now I simply drag & drop the required m-File into my current directory.
Is there a way to include my "collection" to call them directly without copying files or entering directory paths? Kind of including them into my own customized functions database.

Thanks for the advice

Subject: Call self-made functions without m-File in current directory

From: Sven

Date: 12 Oct, 2009 14:56:05

Message: 2 of 3

Hi Jonas,
Yes.

If you store your set of functions in a given directory, say "C:/myfunctions/", you can then do the following:
addpath('C:/myfunctions/')

This will add your functions so that they are always available. I have the same setup, and I put the addpath() call into my startup script, so that my functions are always available.

Thanks,
Sven.

"Jonas Baumann" <baumann.jonas@gmail.com> wrote in message <havdcd$kri$1@fred.mathworks.com>...
> Over time I accumulated a few very simple tough (for me) very useful) functions that I reuse often during all kinds of tasks.
>
> Up to now I simply drag & drop the required m-File into my current directory.
> Is there a way to include my "collection" to call them directly without copying files or entering directory paths? Kind of including them into my own customized functions database.
>
> Thanks for the advice

Subject: Call self-made functions without m-File in current directory

From: Jonas Baumann

Date: 14 Oct, 2009 06:11:02

Message: 3 of 3

Hi Sven,

Thanks a million, this is exactly what I was looking for.

Regards,
Jonas

"Sven" <sven.holcombe@gmail.deleteme.com> wrote in message <havg25$k8b$1@fred.mathworks.com>...
> Hi Jonas,
> Yes.
>
> If you store your set of functions in a given directory, say "C:/myfunctions/", you can then do the following:
> addpath('C:/myfunctions/')
>
> This will add your functions so that they are always available. I have the same setup, and I put the addpath() call into my startup script, so that my functions are always available.
>
> Thanks,
> Sven.
>
> "Jonas Baumann" <baumann.jonas@gmail.com> wrote in message <havdcd$kri$1@fred.mathworks.com>...
> > Over time I accumulated a few very simple tough (for me) very useful) functions that I reuse often during all kinds of tasks.
> >
> > Up to now I simply drag & drop the required m-File into my current directory.
> > Is there a way to include my "collection" to call them directly without copying files or entering directory paths? Kind of including them into my own customized functions database.
> >
> > Thanks for the advice

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com