How to linear fit two y variables in same plot?

3 Ansichten (letzte 30 Tage)
Shyam Pahari
Shyam Pahari am 25 Mai 2022
Beantwortet: Walter Roberson am 25 Mai 2022
Hello,
I ploted (x1,y1) and (x2,y2) in same plot where all variables are different. I want to find linear fit for each of them ie x1,y1 and x2,y2 , However, the basic fit ui let me choose either data 1 or data 2 linear fit, but not both. How can I fit both data series simultaneously? thank you.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 25 Mai 2022
polyfit(x1, y1, 1)

Weitere Antworten (1)

Torsten
Torsten am 25 Mai 2022
Bearbeitet: Torsten am 25 Mai 2022
Choose X = [x1,x2], Y = [y1,y2] as data to be fitted.

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by