help-octave
[Top][All Lists]
Advanced

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

Re: ARG?


From: Jordi Gutiérrez Hermoso
Subject: Re: ARG?
Date: Tue, 21 Jun 2011 08:42:14 -0500

On 21 June 2011 08:26, Ben Abbott <address@hidden> wrote:
> On Jun 21, 2011, at 6:02 AM, Bazman76 wrote:
>
>> Hi there,
>>
>> The code below was posted at the following address:
>>
>> http://www.quantcode.com/modules/mydownloads/singlefile.php?lid=495
>>
>> Just wondered what significance the "1;" has (I am compltetly new to octave)

> The "1;" has no significance.

In this particular example, it's cargo cult. Otherwise, it's a silly
hack for distinguishing function files from scripts. The way the
Matlab/Octave language works is that if the first statement is a
function definition, then that file is treated as a function file. The
1; is a trick to not make the first statement a function definition,
hence make the file is a script file. Here it's unnecessary because
the statement in that file immediately following the 1; is not a
function definition.

>> Also what does the arg function do?

It's the argument (angle) of a complex number

>> (more generally is there a resource where I can type in an octave
>> function name and find out what it does?)

Yes, Octave is such a resource. Type "help foo" to figure out what foo
does.

You can also use this:

     http://octave.sourceforge.net/functions_by_alpha.php

HTH,
- Jordi G. H.


reply via email to

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