help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing parametes to a script file from inside Octave


From: fork
Subject: Re: Passing parametes to a script file from inside Octave
Date: Fri, 1 Oct 2010 15:32:06 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Daniel Arteaga <daniel.arteaga <at> gmail.com> writes:

> 
> Is there any way I can pass parameters to a script? When calling a 
> script directly, from the OS command-line, it's easy. But what if I am 
> inside an Octave session?

As I understand it, "scripts" don't have "parameters".

You can "source" a script, which runs it inside the current scope, and therefore
with access to all the variables that were defined before you called "source",
and leaving any newly instantiated variables inside your toplevel scope.  

If you need to encapsulate code, then you *need* to write a "function" (which is
a very different beast than a "script", but I think you know that).

> To clarify: I do not want to call a function, I want to call a script.

I think the terminology would be: one "calls" a function, or one "sources" a
script, but never vice versa.

HTH



reply via email to

[Prev in Thread] Current Thread [Next in Thread]