I want to change xlim,ylim of axes , and draw a circle at the point I chose when I click on a place in the axes in GUI

조회 수: 1 (최근 30일)

채택된 답변

KSSV
KSSV 2021년 10월 25일
th = linspace(0,2*pi) ;
R = 1. ; % Radius of circle
x = R*cos(th) ; y = R*sin(th) ;
figure
axis([-5 5 -5 5]) ; % cahange axes here to your desired
[Cx,Cy] = getpts() ; % click where you want to draw circle; double click to exit
hold on
% plot the circles
for i = 1:length(Cx)
plot(Cx(i)+x,Cy(i)+y)
end
axis equal

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by