How to linear fit two y variables in same plot?

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.

 採用された回答

Walter Roberson
Walter Roberson 2022 年 5 月 25 日

0 投票

polyfit(x1, y1, 1)

その他の回答 (1 件)

Torsten
Torsten 2022 年 5 月 25 日
編集済み: Torsten 2022 年 5 月 25 日

0 投票

Choose X = [x1,x2], Y = [y1,y2] as data to be fitted.

カテゴリ

ヘルプ センター および File ExchangeLinear and Nonlinear Regression についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by