How to make plot with enter the coordinate

조회 수: 1 (최근 30일)
gyeonggeun kim
gyeonggeun kim 2021년 3월 23일
댓글: gyeonggeun kim 2021년 3월 23일
I want to make a plot with coordinate.
Starting the plot I want to get the exact coordinate.
Is there any mathod with keyboard?
  댓글 수: 12
Geoff Hayes
Geoff Hayes 2021년 3월 23일
If you want to enter the coordinates you want and then do something with them, you could try
prompt = {'Enter latitude (degrees):','Enter longitude (degrees):'};
dlgtitle = 'Input coordinates';
answer = inputdlg(prompt,dlgtitle)
latitude = str2double(answer{1});
longitude = str2double(answer{2});
% do whatever checks you need here for valid latitude and longitudes
if abs(latitude) > 90
latitude = mod(latitude,90);
end
if abs(longitude) > 180
longitude = mod(longitude,180);
end
fprintf('latitude is: %f\n', latitude);
fprintf('longitude is: %f\n', longitude);
But it still isn't clear to me that this is really what you are asking for.
gyeonggeun kim
gyeonggeun kim 2021년 3월 23일
Thank you very much! I will try it

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by