Generating a categorical array with group names

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

 채택된 답변

Jeff Miller
Jeff Miller 2021년 9월 6일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2021년 9월 5일

답변:

2021년 9월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by