help-octave
[Top][All Lists]
Advanced

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

Re: Question re function in .m file


From: Miroslaw Kwasniak
Subject: Re: Question re function in .m file
Date: Wed, 15 Dec 2004 03:29:40 +0100
User-agent: Mutt/1.5.6+20040907i

On Tue, Dec 14, 2004 at 09:01:24PM -0500, Paul Kienzle wrote:
> These are expected errors.
> 
> When you type the function f directly into octave it
> defines the function f.  When you put it into quaderror.m
> it defines the function quaderror.m, which when loaded finds
> that it is named f and warns you.
> 
> The x undefined error is because you didn't use
> quaderror(x), but instead called it without any
> arguments.  If you said 'f' on the command line
> after defining f directly on the command line you
> would have seen a similar error.
> 
> - Paul

If John will preload function f from file he can use

  source("quaderror.m")

or use "force script not function m-file" trick writting for example 

0;
function y = f(x)

Mirek



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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