Using dimension labels programmatically / dynamically in a loop
jcor
Is there any way to use dimension labels in a programmatic or dynamic way?
For example, I want to do
// ...
variable i=0
do
string thisLabel = stringFromList(i, listOfLabels)
labelledWave[%thisLabel]
i += 1
while (i < 10)
variable i=0
do
string thisLabel = stringFromList(i, listOfLabels)
labelledWave[%thisLabel]
i += 1
while (i < 10)
... but this considers 'thisLabel' as the label. Adding $ or similar didn't work for me. Thanks in advance.
variable i=0
do
string thisLabel = stringFromList(i, listOfLabels)
labelledWave[%$thisLabel]
i += 1
while (i < 10)
(The % needs to be between the [ ], not within the string thisLabel)
January 21, 2015 at 05:16 am - Permalink
variable i=0
make /O /N=3 labelledWave
string listOfLabels="a;b;c;"
do
string thisLabel = stringFromList(i, listOfLabels)
SetDimLabel 0, i, $thislabel, labelledWave
labelledWave[%$thisLabel]=42+i
print labelledWave[%$thisLabel]
i += 1
while (i < 3)
end
HJ
January 21, 2015 at 05:25 am - Permalink
http://www.igorexchange.com/node/6249
EDIT
Oh, I think I misunderstood the question, which doesn't seem to be about labeling, but rather using them….
January 21, 2015 at 06:10 am - Permalink