[Thread Prev][Thread Next][Index]

Re: variable indices and embedded expressions



Hi Michael,
You might check into the SAMPLE functions if you want to
extract certain elements of your variables. That might be a better
method, depending on what you are trying to do.

Does your array2 have a Z dimension? Is the result of INDA a
single number, and is it a valid index in the variable ARRAY2?
The grave-accent syntax must evaluate to a simple scalar value.
You might try the STAT command to check the dimensions and
values of your variables.

I do this example which seems to work fine:

yes? let array1 = {1,3,5,7,9,11}
yes? let array2 = ZSEQUENCE({2,4,6,8,10,12,14,16})
yes? let a = 3
yes? let inda = array1[i=`a`]
 !-> DEFINE VARIABLE inda = array1[i=3]
yes? list array2[k=`inda`]
 !-> list array2[k=5]
             VARIABLE : ZSEQUENCE({2,4,6,8,10,12,14,16})
             Z        : 5
          10.00



Michael Traub wrote:

> Dear ferreters!
>
> Yesterday I had a problem with embedded expression which was solved by
> you. I hope this time it will happen once more!
>
> LET A=100                                                            !
> number  of  an element in an array ARRAY1
> LET INDA=INTPOSTWO[i=`A`]                 ! an index number that is used
> to get an specific element out of
>
>             ! array ARRAY2
>
>
>
>              ! trying to get element with number INDA of array ARRAY2
> LIST ARRAY2[K=`INDA`]                                    //////  that
> does not work
> LIST ARRAY2[K=`INTPOSTWO[i=`A`] `]     //////   that does also not work
>
> WHAT TO DO ???????
>
> greetings
>
> Michael
>
>
> --
> =====================================================
>
> Michael Traub
> Max-Planck Institute for Chemistry
> Department of Atmospheric Chemistry
> P.O. Box 3060
> 55020 Mainz
> Germany
>
> phone: +49 6131 305-437
> fax:   +49 6131 305-436
> e-mail: mtraub@mpch-mainz.mpg.de

--
Ansley Manke  Pacific Marine Environmental Laboratory  Seattle WA




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement