As Carl said, there are no vector variables in Gnuplot. I use a different approach to get around this limitation. I define 2 functions that get and set values ββfor a variable backstage whose name includes an index. Functions:
aGet(name, i) = value(sprintf("_%s_%i", name, i)) aSet(name, i, value) = sprintf("_%s_%i = %.16e", name, i, value)
To assign and receive values ββin array A, you do
eval aSet("A",2,3) print aGet("A",2)
What these functions do is access the variable named _A_2.
You can build a similar function for working with matrices:
mGet(name, i, j) = value(sprintf("_%s_%i_%i", name, i, j)) mSet(name, i, j, value) = sprintf("_%s_%i_%i = %.16e", name, i, j, value)
bmello
source share