Show equation on the 3D Plot

3 ビュー (過去 30 日間)
Samir Albadri
Samir Albadri 2020 年 8 月 15 日
編集済み: Walter Roberson 2023 年 5 月 26 日
Greeting All
Can I get multiple regression equation in matlab code and show the equation on the 3D Plot.
I ihave three axeis X, Y , and Z.
Best regards
Samir
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 8 月 16 日
text() can be passed x, y, and z coordinates to place text at.
But more common would be to create a character form of the equation and title() it.
Samir Albadri
Samir Albadri 2020 年 8 月 16 日
Thanks for your quick replay.
What I need is to get the multiple regression equation from the data by using a code for that and then show it on the 3D plot.
Regards

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

採用された回答

Prabhanjan Mentla
Prabhanjan Mentla 2020 年 8 月 18 日
Hi,
I assume the question needs two things one is getting the equation and then plotting on to the figure.
Multilinear regression (3d plot) may be solved using code in this link.
The below code can be added in the above link(after zlabel) to get figure title.
caption = sprintf('y = %f + %f * x1 + %f * x2 + %f * x1*x2', b(1),b(2),b(3),b(4));
text(15,185,45, caption, 'FontSize', 10, 'Color', 'r', 'FontWeight', 'bold');
You may get similar type of figure like below.
Hope this helps.
  1 件のコメント
Mohammed Saifuddin Ustad
Mohammed Saifuddin Ustad 2023 年 5 月 26 日
編集済み: Walter Roberson 2023 年 5 月 26 日
hey prabhanjan this is similar to a question i have
can you see if you can help?

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

その他の回答 (1 件)

Samir Albadri
Samir Albadri 2020 年 8 月 20 日
Hello
I attach the code. I used. I tried what you recomended but for somehow it did not work
Can you see it
Thanks in advance

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by