How to compare between two surface plots in matlab?

조회 수: 37 (최근 30일)
Adi Nor
Adi Nor 2020년 11월 12일
댓글: Star Strider 2020년 11월 12일
A and B are two 2D matrices with dimensions (length(X), length(Y)) which are function of X and Y vectors. I plot A and B in a 3D graph using surf as follows:
figure(1)
surf(X,Y,A)
hold on
surf(X,Y,B)
hold on
But, the generated figure doesn't show the difference in values between A and B clearly.
Is there any other way where I can compare between A and B in a 3D plot and show the differences between them clearly?

채택된 답변

Star Strider
Star Strider 2020년 11월 12일
Perhaps:
figure(1)
surf(X,Y,A, 'FaceAlpha',0.5)
hold on
surf(X,Y,B, 'FaceAlpha',0.5)
hold off
.
  댓글 수: 8
Adi Nor
Adi Nor 2020년 11월 12일
Thank you! it works well now.
Star Strider
Star Strider 2020년 11월 12일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 11월 12일
Sometime plotting the difference can be helpful for visualization
figure(1)
surf(X,Y,A-B)
  댓글 수: 7
Ameer Hamza
Ameer Hamza 2020년 11월 12일
Try the code in my last comment.
Adi Nor
Adi Nor 2020년 11월 12일
Thank you! .. your solution is acceptable for me.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by