a and b constant
1 回表示 (過去 30 日間)
古いコメントを表示
HI, im new to matlab and was wondering how would you input a command to help me solve an unknown constant in an equation.
I have a bunch of x,y points,The equation would be x= a*y+b
0 件のコメント
採用された回答
Image Analyst
2019 年 4 月 21 日
You say "The equation would be x= a*y+b" and this is the opposite to the way people usually do things, but it can be done. Just reverse x and y when you call polyfit(). Try this:
coefficients = polyfit(y, x, 1); % x as a function of y - note NOT the usual way people do things!
a = coefficients(1)
b = coefficients(2)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Christmas / Winter についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!