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!