How to shift data in a 3D plot?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have 2 plots, a Prescan and a Postscan, each generated from 65536 (256x256) surface z-coordinates. I used surf and Matlab automatically generate 3D plot. The X- and Y values are 1-256.
Now I would like to substract the Prescan from the Postscan to determine the wear volume. But there is an offset between both scans and therefore I need to shift every Postscan data by Y=-1. Do you know how to do this?
I tried to remove the first row and column of the Postscan data. But if I do this, I cant substract Post- and Prescsan, because they have a different size.
I attached a picture of the problem. This pictures shows the top view of what happens, when I overlay both scans with the hold command. You can see in the 4 circles, there is an offset between the Prescan (blue point) and Postscan (yellow point). They have to be at the same position.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/334134/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/334134/image.png)
0 comentarios
Respuestas (2)
jonas
el 19 de Jul. de 2020
You just need to pass x and y data to surf.
surf(1:256, 0:255, Z)
0 comentarios
Star Strider
el 19 de Jul. de 2020
The easiest way might be to use the circshift function on the appropriate matrix in the appropriate dimension. Then, do the subtraction.
0 comentarios
Ver también
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!