From: Scott Tyler on
I would like to pass an .m-file as an argument to a second .mfile. Can anyone suggest how I might do this?
Thanks,
Scott
From: Walter Roberson on
Scott Tyler wrote:
> I would like to pass an .m-file as an argument to a second .mfile. Can
> anyone suggest how I might do this?

The _name_ of a .m file is a string.
The _content_ of a .m file is a character array or cell string array.

What are you going to *do* with the .m file in the second .m file? If
the first .m file is a function and you will need to invoke the
function, consider passing a function handle.
From: us on
"Scott Tyler" <styler(a)live.com> wrote in message <i0snfm$8n9$1(a)fred.mathworks.com>...
> I would like to pass an .m-file as an argument to a second .mfile. Can anyone suggest how I might do this?
> Thanks,
> Scott

a hint:
- pass the name is a CHAR string, eg,
fun('unique',...)
- pass a FUNCTION HANDLE, eg,
fun(@unique,...)

us
From: Scott Tyler on
Walter Roberson <roberson(a)hushmail.com> wrote in message <5nmYn.5816$xZ2.2398(a)newsfe07.iad>...
> Scott Tyler wrote:
> > I would like to pass an .m-file as an argument to a second .mfile. Can
> > anyone suggest how I might do this?
>
> The _name_ of a .m file is a string.
> The _content_ of a .m file is a character array or cell string array.
>
> What are you going to *do* with the .m file in the second .m file? If
> the first .m file is a function and you will need to invoke the
> function, consider passing a function handle.
From: Scott Tyler on
Walter Roberson <roberson(a)hushmail.com> wrote in message <5nmYn.5816$xZ2.2398(a)newsfe07.iad>...
> Scott Tyler wrote:
> > I would like to pass an .m-file as an argument to a second .mfile. Can
> > anyone suggest how I might do this?
>
> The _name_ of a .m file is a string.
> The _content_ of a .m file is a character array or cell string array.
>
> What are you going to *do* with the .m file in the second .m file? If
> the first .m file is a function and you will need to invoke the
> function, consider passing a function handle.

I tried passing a function handle and that worked well.
Thanks,
Scott