Understanding the code snippet

3 次查看(过去 30 天)
atan
atan 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 CenterFile Exchange 中查找有关 Condensed Matter & Materials Physics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by