Create a set of sets

32 visualizaciones (últimos 30 días)
David Smalenberger
David Smalenberger el 5 de Mayo de 2020
Respondida: Raghul Dhanesh el 13 de Dic. de 2020
Hi Team!
Is there a way in Matlab to create a set of sets?
V = [[1 2] [1 3] [1 2 3]];
I tried quite a few methods but the only one that worked is to convert everything to a string and then do a bunch of string manipulations. I would expect that Matlab would have a better way to handle this. Also, the sets can vary in the number of elements.
Thanks for the assist!

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 5 de Mayo de 2020
David - try using a cell array:
V = {[1 2] [1 3] [1 2 3]};
  1 comentario
David Smalenberger
David Smalenberger el 5 de Mayo de 2020
I knew Matlab had an solution. Thank you!

Iniciar sesión para comentar.

Más respuestas (1)

Raghul Dhanesh
Raghul Dhanesh el 13 de Dic. de 2020
V = [[1 2] [1 3] [1 2 3]];

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by