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

1 Ansicht (letzte 30 Tage)
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 Kommentar
Silver
Silver am 14 Nov. 2018
Bearbeitet: Silver am 14 Nov. 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 !

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 30 Jan. 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.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by