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

3 次查看(过去 30 天)
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 个评论
Silver
Silver 2018-11-14
编辑:Silver 2018-11-14
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 !

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2018-1-30
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.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by