Filter löschen
Filter löschen

DRAW LINES POINT TO POINT WHITH GINPUT

2 Ansichten (letzte 30 Tage)
Gabriela Alessandra
Gabriela Alessandra am 13 Okt. 2023
Beantwortet: Image Analyst am 14 Okt. 2023
Hello, how I can to draw lines point to point whit my mouse in the plane x,y and x,y,z?

Akzeptierte Antwort

Florian Bidaud
Florian Bidaud am 13 Okt. 2023
Bearbeitet: Florian Bidaud am 13 Okt. 2023
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.

Weitere Antworten (1)

Image Analyst
Image Analyst am 14 Okt. 2023

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by