BWremain = true(300);% Number of random coordinates
N = 100;% Selected coordinates are stored these variables
row = nan(N,1);col = nan(N,1);for kk = 1:N BW = false(300); p = find(BWremain); p = p(randperm(numel(p),1)); BW(p) = true; BW = bwdist(BW) > 20; BWremain = BWremain & BW; [row(kk),col(kk)] = ind2sub(size(BWremain),p)end
MATLAB: For the same answer,,suppose, X ranges from 1 to 500, y ranges from 1 to 200 , Is it possible to find how many such coordinates are possible so that distance from each and every coordinate to other coordinate is > 20
homeworkmonte carlo experiment
Best Answer