help-octave
[Top][All Lists]
Advanced

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

Re: data structure indexing


From: Jaroslav Hajek
Subject: Re: data structure indexing
Date: Tue, 20 Oct 2009 22:19:17 +0200

On Tue, Oct 20, 2009 at 10:01 PM, Pavel Schor <address@hidden> wrote:
> hi, in my script I would like to have airfoils data stored in structure
> like this:
>
> Airfoil.anr.REYNOLDS.re= matrix with lifting line
>
> where "anr" means airfoil number from "database"
> and   "re" means reynolds  number
>
> this is necessary because of lifting line variation which depends on
> reynolds number.
>
> My question: is possible to be "anr" and "re" integers? I would like to
> call appropriate lifting line by this:
>
> Airfoil.1.REYNOLDS.5000000
>

The built-in struct doesn't support numeric fields, and the language
doesn't even allow them be written like this.
You need to convert the numbers to valid identifiers, using sprintf or num2str.
The "dict" class from OctaveForge general package can take arbitrary
keys, so the requirements are weaker.
Finally, you can define a custom class supporting precisely the style you want.

hth

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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