Understanding the code snippet

3 ビュー (過去 30 日間)
atan
atan 2019 年 4 月 10 日
回答済み: Star Strider 2019 年 4 月 10 日
I do not understand what this is doing exactl Can anyone help?
eye_matrix = eye(num_labels);
y_matrix = eye_matrix(y,:);

回答 (1 件)

Star Strider
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.

カテゴリ

Help Center および File ExchangeCondensed Matter & Materials Physics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by