Hello!
From the code snippet you just uploaded, I think there’s a syntax error in the way the "surf" function has been called. Calling the surf function with the
surf(newX3,newY3,newZ3,newStressZ3)
syntax passes the variable "newStressz3" as a colour variable, thus changing the way the values get plotted.
To plot the points exactly on the point they are on, try using the hold statement to plot all the variables on the same axes.
surf(newX3)
hold on
surf(newY3)
surf(newZ3)
surf(newStressZ3)
hold off
The result looks something like this:
You may refer to the following documentation for:
Hold statement: https://www.mathworks.com/help/matlab/ref/hold.html?searchHighlight=hold&s_tid=srchtitle_hold_1
Hope this helps!