Find the function between variables

3 views (last 30 days)
S
S on 28 Jun 2011
Hi everyone,
Got a question. I have 4 data, W, G, V1, V2, and let say W changes from 0 to 0.5 and G has got it own values, the same case for V1 and V2. By the way, I got these values from measurment. I want to find out the relationship between V1, W and G and also the relationship between V2, W and G, I mean
V1=F(W,G)
V2=F(W,G)
I want to find this F. Does MATLAB can do it for me by just giving the data?
Sorry if that sounds silly! I will appreciate your help.

Answers (2)

Oleg Komarov
Oleg Komarov on 28 Jun 2011
doc polyfit
I addition to Walter's comments you may want to plot the data to see if the data follows some known relationship (e.g. linear, quadratic etc...).
If you have the Stats TB then using plotmatrix could be a good start.
  2 Comments
Walter Roberson
Walter Roberson on 28 Jun 2011
Note: polyfit() is only suitable for single variables, not for multivariate.
Oleg Komarov
Oleg Komarov on 28 Jun 2011
Right, thus I agree with your last comment.

Sign in to comment.


Walter Roberson
Walter Roberson on 28 Jun 2011
If you have a finite set of data, there are a (literally) infinite number of different functions that exactly match the data. I would say that "there are even more functions if the data is considered to have noise", but of course there isn't any number that is "more" than infinity ;-)
So... in order to find a useful relationship between the values, you need to start with a model of what the relationship could be. If you have a model, you can use the data to calculate the parameters for the model that would best fit the data; if you do not have a model to start with, you have no way of knowing whether any particular relationship is "good" or not.

Community Treasure Hunt

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

Start Hunting!