Function or code in Matlab that can determine the linear equation given input data on two variables
Ältere Kommentare anzeigen
Hello Matlab wizards, I am having a bit of challenge running an optimization problem here. I was wondering if there is a way; command, code or some sort of function in Matlab that can determine the linear relationship between two sets of variables. something like Y=a+Xb; Y, and X are the variables, a is the intercept and b is the slope. I have data set for Y and X and I can draw the plot(Supply curve in my case to be very specific). I will elaborate a little bit more in boring Economics terms; suppose a supply function f that represents a relationship between Price and Q. So I am trying to determine what the equation for my plots/lines could be in form of Q=a-P*b (in this case Q is Y and P is X). Can this be done in Matlab or am I way out of luck here? Thank you so much in advance
Antworten (1)
Star Strider
am 28 Sep. 2016
0 Stimmen
2 Kommentare
Amine Ben Ayara
am 29 Sep. 2016
Star Strider
am 30 Sep. 2016
My pleasure.
You can fit a second-degree polynomial with polyfit.
Sorry for the delay. Life and software updates intrude.
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!