Matrix Manipulation code help
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a training label for 3 different classes in a matrix of size 1*178 example t=[1 1 1 3 1 2 3 1 ... .....]. Anyone please help me to write an efficient code for generating a new matrix of size 3*178 where based on the value in "t", the corresponding location in columns should be 1.
for the above example. the output will be like the following matrix:
[1 1 1 0 1 0 0 1.... 0 0 0 0 0 1 0 0..... 0 0 0 1 0 0 1 0.....]
댓글 수: 0
채택된 답변
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!