Borrar filtros
Borrar filtros

Understanding the code snippet

2 visualizaciones (últimos 30 días)
atan
atan el 10 de Abr. de 2019
Respondida: Star Strider el 10 de Abr. de 2019
I do not understand what this is doing exactl Can anyone help?
eye_matrix = eye(num_labels);
y_matrix = eye_matrix(y,:);

Respuestas (1)

Star Strider
Star Strider el 10 de Abr. de 2019
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.

Categorías

Más información sobre Debugging and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by