473,699 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interpolate data from tabel

Hi.

I need to interpolate som data i have in my tabel.
my tabel looks like this.
Y X
0
0 0,026
0,037
0,003 0,038
0,005 0,064
0,067
0,074
0,008 0,077
0,01 0,09
0,093

but i need a smart way to interpolate the emty places in Y.
i did make som code in vba, but it takes about 3 min for 1100
recordset, and its to slow, there for im asking for some help with som
codes .
hope somone can help :(
thanks

Jan 5 '06
15 2630
Yes, I did in 1998.

So I checked it again against:
http://www.bbc.co.uk/education/asgur...inciples.shtml
----
BBC example:
x y
1 1
3 7

Simplifying this expression:
y - 1 = 3 × 1.179 = 3.537 Implies that y = 4.537

----
I created my data table and entered
Data

X Y
1.0000 1.0000
3.0000 7.0000
2.1790
----
I ran my code and got:

X Y
1.0000 1.0000
3.0000 7.0000
2.1790 4.5370

****
As I explained this code was written many years ago for Access 97,
maybe even Access 95.
Because newer versions of Access often have ADO referenced before DAO
minor modifications may be required as follows:

Dim m As Currency, b As Currency

Sub sInterpolation( )
Dim strSQL As String
Call sRegressionLine
strSQL = "UPDATE Data SET Data.Y = " & _
"(" & m & ")" & " * Data.X + (" & b & ")" & _
" WHERE (((Data.Y) Is Null) AND ((Data.X) Is Not Null));"
Debug.Print strSQL
CurrentDb.Execu te strSQL
Debug.Print m
Debug.Print b
End Sub

Sub sRegressionLine ()
Dim dbs As DAO.Database, rcs As DAO.Recordset
Set dbs = CurrentDb()
Set rcs = dbs.OpenRecords et("SELECT Sum(Data.X) AS SumX, " & _
"Sum([X]*[X]) AS SumXX, Sum(Data.Y) AS SumY, Sum([X]*[Y]) AS SumXY," &
_
"Count(*) AS N FROM Data " & _
"WHERE (((Data.X) Is Not Null) AND ((Data.Y) Is Not Null));")
m = (rcs!N * rcs!SumXY - rcs!SumX * rcs!SumY) / (rcs!N * rcs!SumXX -
rcs!SumX ^ 2)
b = (rcs!SumY * rcs!SumXX - rcs!SumX * rcs!SumXY) / (rcs!N * rcs!SumXX
- rcs!SumX ^ 2)
End Sub

Jan 5 '06 #11
Well I first posted it here in 1998. It's a bit hard to remember but I
think so.

Jan 5 '06 #12
Well, of course. I stopped everything I was doing including my paying
work and ran a complete test. Then I sent it to three expert
mathematicians and three other developers for further vaildation.
Then I felt it was OK to say
"This is old. Maybe it will help. Maybe not."

Jan 5 '06 #13
LOL

Jan 5 '06 #14
hi Lyle.

maybe i did go to far, you sent me a solution and.....sory.
I did try to make this solution to work, and it works now, but now my
graph i not liniear, dont know why.
But anyway thanks for the help

Jan 6 '06 #15
is this code linear interpolation ?

Jan 6 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3842
by: Alex | last post by:
Hi, I need to perform cubic spline interpolation of a dataset. I am using scipy. When I pass two arrays (x,y) to the interpolate.splrep(x,y) function I get the following traceback Traceback (most recent call last): File "./optmat.py", line 138, in ? initspline = interpol.getspline(initkeys,inittable) File "./optmat.py", line 77, in getspline
1
4430
by: Nothing | last post by:
I received a db2 data file that I converted to MS-Access. From Access I ran the upsize wizard to put the tabel in SQL. It put the table in ok but all the data types are nvarchar. I have a couple of the fields that are cureny and some that are numeric. I need to change the data types from nvarchar to numeric type fields. I am new to SQL so I do not know all the commands. How do I change the data type? Michael Charney
4
1592
by: Roland Wolters | last post by:
Hi, I am reading data from a unix odbc datasource in a c# program. Reading the data as works fine, but one field, contains a date-time format that .net does not understand. The query would be: "Select birthdate from <tabel> where bla bla" We use an odbc command object, and an odbcdatareader.
9
1505
by: elia | last post by:
Hello, I would like to show a line in a tabel in html if there is quantity of article choosed. My code is: <? if ($quantite1 0) { echo(' <tr>
4
4402
by: sanparab | last post by:
I am a new user for MS Access 2003, I want to transfer a data of Fixed lenght text file into Access Tabel. The data is contained of four Record Set those are as follows 1. The header record type is ‘H’. 2. The detail record type is ‘D’. 3. The summary record type is ‘S’. 4. “END OF DOCUMENT” record is left justified with no record type. and the data is as follows
7
1848
by: Kristiansj | last post by:
Hey, I am a fairly novice coder and I am having some trouble making an elegant solution to the following problem: (pseudocode) ------------ switch (something) { case (something1) tabel = tabel_1 case (something2) tabel = tabel_2 etc....
0
1517
by: Steve Kirby | last post by:
You can't ... What you might try is: desc tabe1 This will list the columns in that table. You can select what you want to pull from that way.
1
1149
by: arunbojan | last post by:
Dear All, Please advice me some tips in ASP.NET to make tabel attractive..... Arun
1
1790
by: tradevol | last post by:
Hi, I have a client app which directly read the byte stream from the socket, which is sent from linux 64 bit server app. One problem I have is that I realize that it seems like the minimum size for the data sent from linux is 4 bytes. even though the server only sent one char. Any short type data is 8 bytes also (instead of 2 bytes as expected in 32bit system). One of the reason to use binary array is to reduce the message
0
8689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8916
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7752
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.