Show equation on the 3D Plot
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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.
채택된 답변
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.
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/347634/image.png)
Hope this helps.
댓글 수: 1
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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!