Filter löschen
Filter löschen

Evaluate the intersection area between the circles and the rectangle with increasing number of circles(N) with increasing number of random distribution samples(qty)?

9 Ansichten (letzte 30 Tage)
qty=1
N=1
Lx=10
Ly=50
%For G1 Circle
meanG1x=75
meanG1y=30000
stddevG1x=Lx/0.6745
stddevG1y=Ly/0.6745
G1x=normrnd(meanG1x,stddevG1x,N,qty)
G1y=normrnd(meanG1y,stddevG1y,N,qty)
%similarly generating centres for G2, G3, G4, G5 & G6
%ploting the centrepoints and their respective circles
G1=scatter(G1x,G1y);
%%similarly plotting all the circles
hold on
TargetArea=rectangle('Position',[-125,29875,250,250],'FaceColor',[1 1 0],'EdgeColor','r',...
'LineWidth',1);
hold on
centreG1= [G1x G1y]
%%similarly for centre G2, G3, G4, G5 & G6
radii=[30]; %%%%%this radii should change for N
hold on
AreaG1=viscircles(centreG1,radii);
%%similarly for Area G2, G3, G4, G5 & G6
hold off
axis equal
C={centreG1,centreG2,centreG3,centreG4,centreG5,centreG6};
radiioverall={30,30,30,30,30,30}
p=cellfun(@polycircle,C,radiioverall);
rect=polyshape([-125,29875;-125,30125;125,30125;125,29875]);
Area=area(intersect(union(p),rect))
function p=polycircle(center,R)
p=translate( nsidedpoly(1e4,'Radius',R), center);
end
For variating the value of N i.e. increasing the set of circles and then solving the overall for 500 simulations...
Need the solution for upper statement...???
  2 Kommentare
Jon
Jon am 8 Mär. 2022
It is not clear from what you have posted what your question/problem is. Please explain what your question is. Are you getting error messages that you don't understand? If so then please copy and paste the entire error message so we can see what it says.
Rohan Shinde
Rohan Shinde am 8 Mär. 2022
if i change the value of N for 2 or more then error commes where the function is called and then even after varying the N i want multiple simulations for that perticular N for average outcomes as there is random distribution case...

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 8 Mär. 2022
Bearbeitet: Matt J am 8 Mär. 2022
Currently, with N>1 you have more centers than you do radii. Also, you have not organized the data as a cell array.The area calculation requires that the data be organized in the form,
C={[cx1,cy1];
[cx2,cy2];
...
[cxM,cyM]};
radiioverall={R1;R2;...;RM}
where M is the total number of circles participating in the calculation.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by