How to initialize polyshape array like "zeros(N,N)"?
I use polyshape in my discrete simulation,
and using "for statement" to get polyshape object for each sampling.
Therefore, I need to initialize N by k array for N elements and k sampling times.
Please let me know.
Thanks

 채택된 답변

Steven Lord
Steven Lord 2021년 12월 5일

3 개 추천

P = repmat(polyshape, 1, 5);
for k = 1:5
P(k) = nsidedpoly(2+k, 'Center', [2*k, 0]);
end
plot(P)
axis equal

댓글 수: 2

裕紀 木村
裕紀 木村 2021년 12월 5일
Thanks for the reply.
It worked fine.
Thank you very much for your help.
Matt J
Matt J 2021년 12월 5일
@裕紀 木村 You should accept-click the answer to certify that it resolved your question.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Elementary Polygons에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 12월 5일

댓글:

2021년 12월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by