Hello,
you might want to experiment with the following functions:
getArray(name, index) = value(sprintf("%s_%i", name, index))
setArray(name, index, value) = sprintf("%s_%i = %f", name, index, value)
Usage would be like this:
> eval setArray("speed", n, val)
> flo(n) = getArray("speed", n)
Maybe a function "evaluate()" to accompany the "eval" command would
be a worthwhile addition.
Bastian
Am 06.04.2011 15:05, schrieb pl...@pi...:
> Hi,
>
> I have to plot some data that depend on a parameter (pump speed) that I
> read in with each line of data. I need to calculate a plot value
> dependant on this value. I had it parametised as a function I call form
> the plot command but this is not accurate enough. I need it to be a
> look-up table (ie array) of values.
>
> flo(dac)=flo_grad*(dac-16)+flo_0;
>
> this needs to be
>
> flo(dac)=speed[n];
>
> I know use of variables is somewhat limited in gnuplot and I can't find
> any documentation that seems relevant. (array keyword referring to input
> format)
>
> I have 16 values so a whole stack of 'if's would be pretty messy.
>
> now am I missing a trick or is this simply not possible with the kind of
> algebra available within a gnuplot script?
>
>
> best regards. Peter.
|