Split data into groups without applying a function

12 vues (au cours des 30 derniers jours)
Raúl García Odriozola
Raúl García Odriozola le 27 Juin 2023
First, i would like to apologize for not showing the code, it's part of a group project and i don't want to show code without permission
That being said i was trying to group data from an array, with findgroup() i was able to make some groups and then create an array that show the group and it's asociated data but instead i would like an array that shows the groups in the first column (1,2,3,4, etc tha name of the groups are irrelevant for now) and on the second column all the data that's from said group. I've been thinking about splitapply but that function always use a function with the data.
For clearification, what i want is the intermediate step of this example image:

Réponse acceptée

Matt J
Matt J le 28 Juin 2023
G=findgroups(Gender);
groupedHeight=splitapply(@(x){x}, Height,G)
  1 commentaire
Raúl García Odriozola
Raúl García Odriozola le 28 Juin 2023
Modifié(e) : Raúl García Odriozola le 28 Juin 2023
Thank you, that's exactly what i'm looking for

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by