필터 지우기
필터 지우기

Random generation of coordinate points that lie outside of defined surfaces.

조회 수: 2 (최근 30일)
nanmi51
nanmi51 2018년 2월 19일
댓글: Rena Berman 2018년 5월 15일
I have a question regarding the generation on random xy coordinates in an already defined area. Now the area is comprised of many little sub-areas representing aggregates in the material's micro-structure. I want the randomaly generated coordinates (i.e. centroids of the air voids) to lie outside those sub-areas. The program I have so far can plot the xy coordinates of all of the nodes making up the lines which connect to establish the sub-areas. Any help would be much appreciated. Thanks.

답변 (1개)

Image Analyst
Image Analyst 2018년 2월 20일
Can you use poly2mask() to make those sub areas into a digital image? If so, then you can use randperm() and the mask to place a specified number of points into the mask regions. If that sounds good, then try it or else if you can't figure it out, give us the points for all the regions (either via source code to generate them, or via an attached .mat file) and we'll do it for you.
  댓글 수: 2
Image Analyst
Image Analyst 2018년 2월 20일
Can you upload a screenshot, like a PNG file? I'll check back later today - I have to leave for somewhere now.
Image Analyst
Image Analyst 2018년 2월 20일
I see. I have to go to another meeting now, but could you post the code to read in the file and create the figure? This would make it quicker and easier for me if you did it for me rather than me having to create that code. I'll look for it. later today.

댓글을 달려면 로그인하십시오.

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by