How to initialize polyshape array?

27 visualizaciones (últimos 30 días)
裕紀 木村
裕紀 木村 el 5 de Dic. de 2021
Comentada: Matt J el 5 de Dic. de 2021
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

Respuesta aceptada

Steven Lord
Steven Lord el 5 de Dic. de 2021
P = repmat(polyshape, 1, 5);
for k = 1:5
P(k) = nsidedpoly(2+k, 'Center', [2*k, 0]);
end
plot(P)
axis equal
  2 comentarios
裕紀 木村
裕紀 木村 el 5 de Dic. de 2021
Thanks for the reply.
It worked fine.
Thank you very much for your help.
Matt J
Matt J el 5 de Dic. de 2021
@裕紀 木村 You should accept-click the answer to certify that it resolved your question.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Elementary Polygons en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by