how do I calculate and highlight values in a 3d graph?

1 view (last 30 days)
what command do I use to highlight a point on a graph and calculate its corresponding values. Ex: I want to know the value of y and z @ x=3.5 on my 3D graph and highlight the point.

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 17 Feb 2021
Edited: KALYAN ACHARJYA on 17 Feb 2021
plot3(x,y,z);
hold on;
grid on;
Get the indice where x=3.5
id=find(x==3.5)
Get the corresponding y and z value
y_data=y(id);
z_data=z(id);
Let suppose you wish to highlight the point where, x=3.5 and corresponding y and z
plot3(x(id),y(id),z(id),'r*','linewidth',2);
Note on Two Things here:
  1. Ensure that there must be respective x value within the x data (which you are looking for), so that id to be non empty data.
  2. Comparing floating points data, very careful, see the following threads

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!