How to rotate/tilt the data of a mesh plot?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
A plot similar to "peaks" shall be tilted. I found a piece of code to rotate/tilt the image object.
but since i have to do some other mathematical operations with the tilted data, i need to tilt the data itself. Can i tilt datda or retrieve the manipulated data from the image object?
I tried this to retrieve the data from the image object, but with no success:
% tilt image
t = hgtransform;
mesh(xr, yr, zr,'Parent',t)
Mx = makehgtform('xrotate',-alphax);
My = makehgtform('xrotate',alphay);
t.Matrix = My*Mx;
%try to retrieve data from image object
h = gcf;
axes = get(h,'Children');
dataObjs = get(axes,'Children');
lineObjs = findobj(dataObjs, 'type', 'surf');
Zdata = get(lineObjs, 'ZData');
objTypes = get(dataObjs, 'Type'); %type of low-level graphics object
Thanks
0 comentarios
Respuestas (1)
Walter Roberson
el 6 de Oct. de 2015
The data that is stored in the mesh is the data that is passed in, not the transformed coordinates. If you want the transformed coordinates then you need to do the matrix multiplications yourself instead of relying on the graphics system. You can still use makehgtform to help you create the transformation matrix.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!