I want to multiply 2 columns, where the index of one of the columns is given as a variable. I tried to multiply column 2
with column ind
as shown below:
do for [j=1:4]{
ind = (j-1)*5+1
plot '../out/coeff.dat' using 1:($2*$ind) notitle with lines
}
I get this error: Column number expected
.
I guess that the error might be in the usage of $ind
as using a numerical value, eg: 1:($2*$3)
or simply 1:ind
works fine.
What is the correct syntax to perform arithmetic operation with a variable column?