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 ExchangeElementary 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