GAMS:获取向量的第 n 个元素

GAMS: Getting the n'th element of a vector

我在参数变量中有一个数据集

set t /t1 * t5/;
parameter mydata(t) /t1 10, t2 20, t3 30, t4 40, t5 50/;

如何以最简单的方式获取 mydata 的第 n'th 个元素。我正在寻找类似的东西:

display mydata(3)

我将在哪里获得值30

set t /t1 * t5/;
parameter mydata(t) /t1 10, t2 20, t3 30, t4 40, t5 50/;

scalar x;

x = sum(t$(ord(t)=3), mydata(t));

display x;