Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Generate a function from a scatterplot


Generate a function from a scatterplot

so i have two vectors. 

One is a time stamp 

the second is y axis data. 


so for each time stamp there is a corresponding data point


I need to plot this scatterplot somehow and then find a line of best fit. 


Then i need to take the integral of it. 

I have tried to use the regress function and the interp function without luck. All i get are errors. 

I cant find a good example online. 

The is just a simple 2d plot. Good old X and Y

Can someone help me with an example. 

I dont understand all the parameters that regress and interp are expecting. 

When i try to plot it just gives me an error. i cant post my sheet because of IP

23-Emerald III

In general: Unless you have a model of the phenomenon that describes the function you want to integrate, there's no better estimate of the total integral than just summing the datapoints you have.

[ You cannot add accuracy that is not present in your data.]

If you do have a model, it makes sense to fit the points to your model and potentially derive model parameters. That will give you a function, which you can integrate.

Please see the discussion here: .




I had a similar topic and it was solved very well here, have a look:


Basically a function which interpolates your datapoints was found with "curveexpert professional"

Afterwards the "genfit" function was used.



Top Tags