[Top][All Lists]

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

Re: Writing functions

From: Przemek Klosowski
Subject: Re: Writing functions
Date: Mon, 26 Oct 2015 13:25:29 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/26/2015 09:37 AM, Jonathan Camilleri wrote:
I resolved this after a bit of trial and error, I needed to rename the file with the same name as the name of the function.  This could be a problem if a file has different functions, so one has to document it to start with and to attempt to provide a solution based on the concept of object orientation where a class would have properties and methods.

While in principle the filename and the name of the Octave function it contains do not have to be the same, and indeed you can have a file that defines more than one function, Octave is optimized for the case where they are the same, i.e. function myfunc() is in the file myfunc.m. If you observe this convention, Octave will find the functions automatically and even reload them from disk if you edit the function definition file.

I wish there was some easier way of writing out my algorithms, sifting through the list of packages seems time consuming already.
Yes but you have to learn it just once and then you're good for life :)

reply via email to

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