Extract X,Y,Z data from a MATLAB figure by interacting with a line parallel to X or Y axis.

1 visualización (últimos 30 días)
Hi, I have a 3 D plot in MATLAB. I want to cut by planes along X or Y axis and plot the Z values of the cut planes, in order to get the 2 D profiles along that plane. Just like many metrology software, image can be read along X and Y axes for profile heights, I want to do similar task from Matlab figure. In MATLAB figure we have option of cursor data, which can give X,Y,Z points on the figure. But I want to data all the data along a line intersecting the figure. Can anyone help me please?
  1 comentario
Silver
Silver el 14 de Nov. de 2018
Editada: Silver el 14 de Nov. de 2018
Hello ! you may use the function colorbar to color the third parameter and you can use the functioon pcolor or scatter
h1 = pcolor(X,Y,Z); % gives a 2D raster plane
shading flat;
axis image;
colorbar;
or
scatter(X,Y,5,Z,'fill'); % gives a 2D line with X and Y axis and variability of the Z is mentionned by the colorbar
colorbar;
set(gca,'yticklabel',X);
set(gca,'xticklabel',Y)
hope that could help you !

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 30 de En. de 2018
If you have (X,Y) data coordinates in hand, for which you want the respective Z values.......you can do interpolation and get those values....and then you can plot. Have a look on ScatteredInterpolant.

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by