Hello everyone,
I could use your help to improve the following code. Its about creating a map with random positions of points.
How to put points only inside of country borders?
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
Best Answer