a*******r 发帖数: 7558 | 1 I have data arrays such as b1, b2, b3,...b100...
To do operations like b2/b1, b3/b1,...., I first do this:
FOR i=1, n DO BEGIN
my_data='b'+strtrim(string(i),1)
ENDFOR
Now the string my_data has become b1, b2,..., but how to
convert the string my_data to reference array data b1, b2...?
There must be such a conversion in IDL but I haven't found,
please help. 3x. | a***f 发帖数: 45 | 2 According to my experience, there is no way to do it.
You have to convert b1, b2, ... to b[1], b[2], ... | a*******r 发帖数: 7558 | 3
有人提出了以下两种办法,供参考。
here are the two methods:
1. Use SCOPE_VARFETCH, which can be compiled in a Runtime program, if
necessary.
The syntax "myArray[i] = scope_varfetch('var')" will copy the value of a
variable named "var" that is
defined in the current scope (scope is where you are running in the current
"call stack" - what routine
call you are currently running in) into 'myArray'.
2. Use EXECUTE, which cannot be compiled in a .sav Runtime program:
EXECUTE treats its string argument as a command th
【在 a***f 的大作中提到】 : According to my experience, there is no way to do it. : You have to convert b1, b2, ... to b[1], b[2], ...
|
|