How can I label a data set?
조회 수: 9 (최근 30일)
이전 댓글 표시
I am preparing some data for the classifier app in MATLAB and want to label my data i.e. I want to add a single column containing 8006 zeroes followed by 3400 ones, 2300 twos, 627 threes, 672 fours and 1006 fives. I have a .mat file for my data.
댓글 수: 0
답변 (1개)
Image Analyst
2018년 10월 28일
You can make a column vector like this
numRows = [8006,3400,2300,627,672,1006]
col = [];
for k = 1 : length(numRows)
col = [col; (k-1)*ones(numRows(k), 1)];
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!