Understanding the code snippet
조회 수: 2 (최근 30일)
이전 댓글 표시
I do not understand what this is doing exactl Can anyone help?
eye_matrix = eye(num_labels);
y_matrix = eye_matrix(y,:);
댓글 수: 0
답변 (1개)
Star Strider
2019년 4월 10일
By inspection, it generates an identity matrix with dimensions (num_labels x num_labels), then assigns the ‘y’ row of it to the ‘y_matrix’ vector. That vector would be all zeros, except for column ‘y’.
Beyond that, I have no idea what the purpose is.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!