How can I store polygons into a list?

7 vues (au cours des 30 derniers jours)
RevengeOfTee
RevengeOfTee le 30 Jan 2020
Commenté : RevengeOfTee le 31 Jan 2020
Say I have two polygons Pol1 and Pol2. How can I store them into a list that is used as an input for a function. My function, at some point, is supposed to be able to pick out polygons from this list and then graph them using polyshape.
Thank you!
Pol1 = [3 4; 1 1; 5 1];
Pol2 = [0 5; 5 5; 0 6; 6 3];

Réponse acceptée

David Hill
David Hill le 31 Jan 2020
Why not load them into a cell array?
Pol1 = polyshape([3 4; 1 1; 5 1]);
Pol2 = polyshape([0 5; 5 5; 0 6; 6 3]);
polyList={Pol1,Pol2};
  1 commentaire
RevengeOfTee
RevengeOfTee le 31 Jan 2020
Works. Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Elementary Polygons dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by