help-octave
[Top][All Lists]
Advanced

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

Re: enum in octave?


From: Matthias Brennwald
Subject: Re: enum in octave?
Date: Mon, 13 Oct 2008 09:28:13 +0200

On Mon, 2008-10-13 at 01:53 -0500, address@hidden
wrote:
> Message: 2
> Date: Fri, 10 Oct 2008 11:49:03 -0700 (PDT)
> From: Jim H <address@hidden>
> Subject: enum in octave?
> To: address@hidden
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Hi,
> I think the question I want to ask is "does Octave have the concept of
> enum
> as in C?"
> 
> My application:  I would like to pass a set of arguments to a function
> in an
> array (p[ ]), but I want to refer to the elements of the array by
> mnemonic
> names like:
> 
> y[BOB] = p[R]*y[BOB]*(1 - y[BOB]/p[K]);
> 
> in C this could be done with #define R 0  #define K 1, etc. or by an
> enum
> structure.
> 
> Possible in octave?
> 
> Jim 

Jim

How about this (in Octave):

---------------
R = 0;
K = 1;
BOB = ...; (insert whatever value needs to go here)
y[BOB] = p[R]*y[BOB]*(1 - y[BOB]/p[K]);
---------------

Cheers
Matthias




reply via email to

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