DRAW LINES POINT TO POINT WHITH GINPUT
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello, how I can to draw lines point to point whit my mouse in the plane x,y and x,y,z?
댓글 수: 0
채택된 답변
Florian Bidaud
2023년 10월 13일
편집: Florian Bidaud
2023년 10월 13일
In the (x,y) plane :
figure
xlim([0 100])
ylim([0 100])
hold on
i = 1
while true
[x(i), y(i)] = ginput(1);
scatter(x(i), y(i),'blue')
p = plot(x,y,Color='blue');
i = i+1;
end
In the (x,y,z) plane you can use the same logic using ginput3d : https://uk.mathworks.com/matlabcentral/fileexchange/34939-ginput-3d
With this function, you need to place yourself in the right plan with the view function each time you add a point, indeed, it is impossible for Matlab to know where in 3D you would like to draw your point.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!