How to compare between two surface plots in matlab?

38 visualizaciones (últimos 30 días)
Adi Nor
Adi Nor el 12 de Nov. de 2020
Comentada: Star Strider el 12 de Nov. de 2020
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?

Respuesta aceptada

Star Strider
Star Strider el 12 de Nov. de 2020
Perhaps:
figure(1)
surf(X,Y,A, 'FaceAlpha',0.5)
hold on
surf(X,Y,B, 'FaceAlpha',0.5)
hold off
.
  8 comentarios
Adi Nor
Adi Nor el 12 de Nov. de 2020
Thank you! it works well now.
Star Strider
Star Strider el 12 de Nov. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (1)

Ameer Hamza
Ameer Hamza el 12 de Nov. de 2020
Sometime plotting the difference can be helpful for visualization
figure(1)
surf(X,Y,A-B)
  7 comentarios
Ameer Hamza
Ameer Hamza el 12 de Nov. de 2020
Try the code in my last comment.
Adi Nor
Adi Nor el 12 de Nov. de 2020
Thank you! .. your solution is acceptable for me.

Iniciar sesión para comentar.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by