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.
26 lines
552 B
26 lines
552 B
|
|
% init |
|
clear |
|
addpath(genpath('./func/')); |
|
|
|
% declear const |
|
Radius = sqrt(5); |
|
Width = 2; |
|
Length = 4; |
|
|
|
% params input |
|
N = input("Shots Times: "); |
|
R = input("Repeating Times: "); |
|
|
|
% draw background |
|
drawBackGround(Radius, Width, Length); |
|
|
|
% calculate prs |
|
[score, totalTimes, prs, d_rx, d_bo] = getDisProb(R, N, Radius, Length, Width, true, @normrnd_circle, @uniform_5case_plus); |
|
|
|
% add legend |
|
legend([d_rx, d_bo], {'scored shot', 'missed shot'}); |
|
t_s = sprintf('Scatter plot for N=%d and R=%d. prs=%d%%', N, R, round(prs*100)); |
|
title(t_s); |
|
|
|
display(prs);
|
|
|