How to plot two independent variables and one dependent variable in a graph?

11 ビュー (過去 30 日間)
Md nazmul al Imran
Md nazmul al Imran 2020 年 8 月 27 日
回答済み: Cris LaPierre 2020 年 8 月 27 日
I have two independent variables, say W and H. Also. one dependent variable, say C. When W=4 and H= 3, the resultant C is 5. Again, when W=4.5 and H= 3.1, the resultant C= 5.9 and so on. So, the variable C is dependent on both W and H and I have their (W and H) combined effect on C.
Is it possible to plot C with respect to W and H in same graph and curve fit them to find any relation like C= a+b*W+c*H?

回答 (1 件)

Cris LaPierre
Cris LaPierre 2020 年 8 月 27 日
If you have 3 variables, you likely need a 3D plot. I would try plot3 or scatter3.
As for fitting the data, try the options provided in this post.

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by