MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Opportunities for recent engineering grads.
Make a vector of length N that consists of all zeros except at index k, where it has the value 1.
N = 6;
k = 2;
vector = one_hot(N,k);
vector = [0 1 0 0 0 0]
2 players like this problem
7 players like this solution