Understanding the code snippet

I do not understand what this is doing exactl Can anyone help?
eye_matrix = eye(num_labels);
y_matrix = eye_matrix(y,:);

Risposte (1)

Star Strider
Star Strider il 10 Apr 2019

0 voti

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.

Categorie

Scopri di più su Condensed Matter & Materials Physics in Centro assistenza e File Exchange

Richiesto:

il 10 Apr 2019

Risposto:

il 10 Apr 2019

Community Treasure Hunt

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

Start Hunting!

Translated by