data structure indexing

View: New views
2 Messages — Rating Filter:   Alert me  

data structure indexing

by Pavel Schor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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



_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: data structure indexing

by Jaroslav Hajek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 20, 2009 at 10:01 PM, Pavel Schor <pavel.schor@...> 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

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave