Generate map with custom border

조회 수: 8 (최근 30일)
azra hosic
azra hosic 2020년 12월 11일
Hello everyone,
I am trying to plot Cities on a random generated map (Travelling Salesman Problem) and I was wondering how to add a border in which I want cities to plot?
For example if I upload an image of a country, how to generate borders so the cities are inside that "country" ?
Here is the code for random map initialization:
C = get(handles.number_cities, 'String');
C = str2double(C);
if(isnan(C)), errordlg('Parameters must be numerical.','Mapping Error');
elseif(C <= 0), errordlg('Number of cities must be greater than zero','Mapping Error');
else
M = zeros(C,2); % Map initialization
for id_C = 1:1:C
M(id_C,1) = randi(100); % Random map
M(id_C,2) = randi(100);
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Traveling Salesman (TSP)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by