Create a function from data points?

Hi guys,
I want to create a function/equation from 10,000 data points. So I have three columns of input and one column of output. I want to be able to create a function y = mx+b type so that I can calculate the outcome with 3 inputs. This way, I want to use this y=mx+b function in something like excel to calculate an output given three input variables. Is this possible? How would I go about doing this? Here's an example:
Input 1: 5 Input 2: 15 Input 3: 0.5
Output: 20
So I want something like ... output = (Input1*2+Input2*2)*Input3
Thank you!

댓글 수: 2

Image Analyst
Image Analyst 2017년 7월 26일
output = (Input1*2+Input2*2)*Input3 is not y=mx+b with unknowns m and b that need to be computed, it's more like y=(2*x1 + 2*x2)*x3, except that you have no unknowns in that model. No coefficients to compute.
A
A 2017년 7월 26일
I understand. All I'm trying to do is .. I have 3 columns of numeric data... and 1 column of numeric output. I want to find a relationship between the 3 inputs and the output that gets resulted... and then I want to get a function that will help me get to that output using the 3 inputs. This way.. I want to put this function in an excel 'cell' and come up with output based on the data in the 3 columns? Thanks!

댓글을 달려면 로그인하십시오.

답변 (1개)

Santa Raghavan
Santa Raghavan 2017년 7월 26일
편집: Santa Raghavan 2017년 7월 26일

0 개 추천

You can use the curve fitting toolbox to generate the model. Use this link to learn more: CurveFit
The toolbox provides the following models for mapping your input to output: Linear polynomial curve, Linear polynomial surface, Quadratic polynomial cu, Local linear regression (surface)
But however for multivariate (more than 3 input) linear fits, you can use the statistics toolbox. Here is a useful link: mvregress
You can also set up your own optimization problem to fit your function as: curve fitting via optimization

카테고리

도움말 센터File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

질문:

A
A
2017년 7월 26일

댓글:

A
A
2017년 7월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by