You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
506 B
30 lines
506 B
5 years ago
|
|
||
|
% init
|
||
|
clear
|
||
|
addpath(genpath('./func/'));
|
||
|
|
||
|
% declear const
|
||
|
Radius = sqrt(5);
|
||
|
Width = 2;
|
||
|
Length = 4;
|
||
|
|
||
|
% declear params
|
||
|
N = 1000;
|
||
|
R = [5, 10, 15, 20];
|
||
|
|
||
|
% declear var
|
||
|
array_prs = [];
|
||
|
|
||
|
% calculate prs
|
||
|
for i = 1 : numel(R)
|
||
|
[score, totalTimes, prs] = getDisProb(R(i), N, Radius, Length, Width, false, @unifrnd_circle);
|
||
|
array_prs = [array_prs, prs];
|
||
|
end
|
||
|
|
||
|
disp(array_prs);
|
||
|
|
||
|
plot(R, array_prs);
|
||
|
xlabel('R random shots');
|
||
|
ylabel('Probability');
|
||
|
t_s = sprintf('Scatter plot for R with N=%d.', N);
|
||
|
title(t_s);
|