- 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.
- Comparing floating points data, very careful, see the following threads
how do I calculate and highlight values in a 3d graph?
1 view (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
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:
0 Comments
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!