Generating a categorical array with group names
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I was wondering how I can generate a 4751x1 cell { } which contains inside three different group names.
So 1055 entries of group1, 1641 entries of group2, 2055 entries of group 3?
Thanks for the help, this is needed for a principal components analysis software
0 个评论
采纳的回答
Jeff Miller
2021-9-6
Is this what you are after?
part1 = repmat({'Name1'},1055,1);
part2 = repmat({'Name2'},1641,1);
part3 = repmat({'Name3'},2055,1);
allparts = [part1; part2; part3];
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Categorical Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!