Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #649

Re: How to extract point data.

From Oliver Jennrich <oliver.jennrich@gmx.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: How to extract point data.
Date 2011-10-19 23:38 +0200
Organization Order of the Eternally Confused
Message-ID <yg1lisgy85h.fsf@ID-371.news.uni-berlin.de> (permalink)
References <31706069.122.1319044340309.JavaMail.geo-discussion-forums@yqoo7>

Show all headers | View raw


Naren <a.narendiran@gmail.com> writes:

> I have a data file containg values of X and Y data.
>
> Example (Y = 2X)
>
> X	Y
>
> 1	1
        2, I assume
> 2	4
> 3	6
> 4	8
> 5	10
> 6	12
>
> When I plot the data I get a nice curve.
>
> However what I want is to get the Y-value for a given X-value. Is it
> possible to extract.

No, not in the general case. However,...
>
> Additionaly, the (X,Y) pair may not be explicity present in the file.
>
> For eg X = 4.5 in the above case. Is it possible to get the Y value
> for X = 4.5 from the above data set and store it in a variable.


... in this case (linear function) you can calculate the inverse
function f^-1(y) 

y=f(x)=ax+b   =>  x = f^-1(y) = (y-b)/a

by fitting a and b to the dataset:

f(x)=a*x+b
g(y)=(y-b)/a

fit f(x) 'datafile' via a,b

print g(4.5)


-- 
Space - The final frontier

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to extract point data. Naren <a.narendiran@gmail.com> - 2011-10-19 10:12 -0700
  Re: How to extract point data. Oliver Jennrich <oliver.jennrich@gmx.net> - 2011-10-19 23:38 +0200
    Re: How to extract point data. Naren <a.narendiran@gmail.com> - 2011-10-20 00:05 -0700
      Re: How to extract point data. Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2011-10-21 22:54 +0200
  Re: How to extract point data. sfeam <sfeam@users.sourceforge.net> - 2011-10-19 14:42 -0700
    Re: How to extract point data. Naren <a.narendiran@gmail.com> - 2011-10-20 00:08 -0700
      Re: How to extract point data. James Cloos <cloos@jhcloos.com> - 2011-10-20 19:34 -0400
      Re: How to extract point data. Ingo Thies <ingo.thies@gmx.de> - 2011-10-21 09:02 +0200
  Re: How to extract point data. ab <ab.3942@googlemail.com> - 2011-10-27 00:46 -0700

csiph-web