Selecting certain points off a plot
显示 更早的评论
I have create a circle and, using ginput, select two points on the circumference of that circle, create a line between those two points and then calculate the distance. This is what I have so far:
Array = linspace(0, 2*pi, 200);
x = cos(Array);
y = sin(Array);
plot(x,y)
[x1, y1] = ginput(2)
plot(x1,y1)
Distance = sqrt(x1.^2+y1.^2)
My problem is how do I confirm that the points selected are actually on the circumference, or is there a specific ginput I can use that will only allow me to select points from that circle.
Creating the line isn't a problem, but calculating the distance is (the distance formula above still comes back with two numbers).
Thanks
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
