3D surface plot in linear regression model

6 ビュー (過去 30 日間)
Pingfei Jiang
Pingfei Jiang 2017 年 8 月 15 日
コメント済み: Pingfei Jiang 2017 年 8 月 16 日
Hi, I used fitlm to obtain linear regression of an experiment in which response Mass is related to H, T and V. I obtained the model with reasonable R-squares and p-value. So I assume the regression model is fine. Now I would like to plot a 3D surface, visualise the response surface of Mass(z-axis) related to H(x-axis) and V(y-axis). All I can find in Matlab tutorial is plotsice function that seems relevant but what I want is a 3D surface. Anyone knows how to do this? Thank you.

採用された回答

John D'Errico
John D'Errico 2017 年 8 月 16 日
編集済み: John D'Errico 2017 年 8 月 16 日
No. You have a FOUR dimensional thing. This is not a surface in 3 dimensions. It is a surface in FOUR dimensions, thus Mass as a function of three variables, (H,T,V).
If you fix the 4th variable that you seem to be ignoring (T) at some value, then use meshgrid to generate points in a grid of H and V. Then evaluate the model at all those points, using surf to plot the result. The result will be valid for the given value of T as chosen in advance.
  3 件のコメント
John D'Errico
John D'Errico 2017 年 8 月 16 日
Exactly.
Pingfei Jiang
Pingfei Jiang 2017 年 8 月 16 日
Great, thank you very much, i will accept your answer

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および 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