Re: Passing MATLAB script as a function parameter



On Nov 30, 12:24 pm, "James " <jalanthomas_no_spamm...@xxxxxxxxxxx>
wrote:
If I have a MATLAB function, is there a way I can pass
a reference to another MATLAB script to that function?

What I would like to do is to use this referenced
[initialization] script to set several directory names to
be used by the function. I want to be able call the
function with different initialization scripts. This way,
my function has no dependency on exactly what the scripts
are. Together, a particular initialization script and the
common/generic function will be used for a given
application.

Or is there a better way to achieve this in MATLAB?

You should be able to pass in the name as a string
argument, which is then used in an EVAL call.

You'll have to decide if you want the EVAL to
take place in the function's scope or in the main
workspace.

- Randy
.



Relevant Pages

  • Re: Passing MATLAB script as a function parameter
    ... a reference to another MATLAB script to that function? ... function with different initialization scripts. ...
    (comp.soft-sys.matlab)
  • Re: Passing MATLAB script as a function parameter
    ... a reference to another MATLAB script to that function? ... function with different initialization scripts. ...
    (comp.soft-sys.matlab)
  • Re: window object
    ... Within a script, every reference to an object amounts to two ... calls from the scripting engine to the DHTML Object Model. ... var sText = document.all.div1.innerText; ...
    (comp.lang.javascript)
  • Re: Decoupling javascript from UserControls
    ... still be able to reference the server-generated IDs. ... your server-side code emit a simple bit ofJavaScriptthat merely writes out ... (where JavaScriptSection is a Literal, ... generation in the markup and set vars as you mentionend in the Render ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: IsValid(Object)
    ... > I have a complex problem involving a linked list, a scripted for-loop, a ... > reference to an object instance, ... > script commands that can arbitrarily modify the database. ...
    (borland.public.delphi.language.objectpascal)