help-octave
[Top][All Lists]
Advanced

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

Re: defining functions at the end of a script file


From: antonio palestrini
Subject: Re: defining functions at the end of a script file
Date: Sun, 19 Aug 2007 00:11:04 +0200

On Wed, Aug 15, 2007 at 05:29:21PM +0200, oxyopes at googlemail.com wrote:

> Optionally, I could group all functions in a separate file, but
> preferably not a file for each function, since they woud not be used
> in other occations, so I make my directory cleaner and work with
> fewer files. Is there a way to do that as well?

you my write all the function needed for a particular task in a file,
let's say myfunct.m
(see below), and then run it loading them all only when you want.

ciao
antonio

------  myfunct.m ----------
disp("loading functions f(x) and g(x)");

function y = f(x)
  y = x.^2;
endfunction

function y = g(x)
  y = sqrt(x);
endfunction
------------------------------------


reply via email to

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